]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Record2.scl
(refs #6924) Support for record field access syntax.
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Record2.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Record2.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Record2.scl
new file mode 100644 (file)
index 0000000..de71cf4
--- /dev/null
@@ -0,0 +1,15 @@
+module {
+    fields
+}
+
+import "Prelude"
+
+data Foo = Foo { x :: Double }
+data Bar = Bar { x :: Double, y :: Double }
+
+main = f.x + b.x + b.y
+  where
+    f = Foo 1.0
+    b = Bar 2.0 3.0
+-- 
+6.0
\ No newline at end of file