]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Overloading3.scl
migrated to svn revision 33108
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / Overloading3.scl
1 // module M1
2 import "Prelude"
3
4 foo :: Ring a => Boolean -> a -> a
5 foo True v = v+1
6 foo False v = v+1 
7 --
8 // module M2
9 import "Prelude"
10
11 foo :: Ring a => String -> a -> a
12 foo cond v = if cond=="true"
13              then v+1
14              else v-1 
15 --
16 import "Prelude"
17 import "M1"
18 import "M2"
19
20 main = foo False (foo "True" 10) :: Integer
21 --
22 10
23