From 8a399abe5a836ba46e36e7123214260c1b955cb3 Mon Sep 17 00:00:00 2001 From: Troels Henriksen Date: Wed, 18 Jan 2023 08:18:28 +0100 Subject: [PATCH] Forgot a test for #1843. --- tests/issue1843.fut | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/issue1843.fut diff --git a/tests/issue1843.fut b/tests/issue1843.fut new file mode 100755 index 0000000000..6ed1a988c9 --- /dev/null +++ b/tests/issue1843.fut @@ -0,0 +1,21 @@ +let N_coating_coefs = i64.i32 8 +let N_coating_specs = i64.i32 26 +type coating = #AntiReflective + | #Mirror + | #Absorbing + | #PhaseGradient_IdealFocus {lam: f64, f: f64} + | #PhaseGradient_RotSym_Dispersive {lam_d: f64, phi0: [N_coating_coefs]f64, GD: [N_coating_coefs]f64, GDD: [N_coating_coefs]f64} + +def parse_coatings (coating_list_array: [][N_coating_specs]f64): []coating = + let parse (specs: [N_coating_specs]f64) : coating = + let enum = i64.f64 specs[0] + in match enum + case 0 -> -- AntiReflective + #AntiReflective + case _ -> + #AntiReflective + in map parse coating_list_array + +entry RayTrace (coating_list_array: [][N_coating_specs]f64) : []coating = + let coatings = parse_coatings coating_list_array + in coatings