(refs #7448) Added Exception effect 84/884/2
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 24 Aug 2017 08:59:27 +0000 (11:59 +0300)
committerJani Simomaa <jani.simomaa@semantum.fi>
Thu, 24 Aug 2017 09:02:31 +0000 (12:02 +0300)
Change-Id: I7a684e1d4b095924d03fd1fdbba2a7aa93794ada

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/Builtins.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java
bundles/org.simantics.scl.runtime/scl/Prelude.scl

index 6df643ea38e17f1e51f2689d0288b7f379d02718..45638c05628043d6553434e1b781059423d573f3 100644 (file)
@@ -103,6 +103,7 @@ public class Builtins extends ConcreteModule {
         addTypeDescriptor("Variant", new StandardTypeConstructor(Types.VARIANT, Kinds.STAR, TypeDesc.forClass(Variant.class)));
         
         addEffectConstructor("Proc", new EffectConstructor(Types.PROC));
+        addEffectConstructor("Exception", new EffectConstructor(Types.EXCEPTION));
         
         //addTypeDescriptor("->", new StandardTypeConstructor(Kinds.STAR_TO_STAR_TO_STAR, Constants.FUNCTION));
         addTypeDescriptor("[]", new StandardTypeConstructor(Types.LIST, Kinds.STAR_TO_STAR, Constants.LIST));        
index 9ea064cfd11bf4abf4094a900a53d9951dc24878..a3db2df52a556f2e523c9e936a0040d53c00f1ea 100644 (file)
@@ -110,6 +110,7 @@ public class Types {
     
     public static final TUnion NO_EFFECTS = new TUnion();
     public static final TCon PROC = con(BUILTIN, "Proc");
+    public static final TCon EXCEPTION = con(BUILTIN, "Exception");
     
     public static final TCon BRANCH_POINT = con(BUILTIN, "BranchPoint");
     
index 818c5054307e95d5ad67bd3b211882fd9dc9befb..f0eca0eb26dc78141f4a4f204f9f46ce14948c2c 100644 (file)
@@ -2123,7 +2123,7 @@ importJava "org.simantics.scl.runtime.procedure.Procedures" where
     
     "Executes the given expression and catches certain class of exceptions (specified by the catch handler that is given as a second parameter.)"
     @JavaName catch_
-    catch :: VecComp ex => (<e> a) -> (ex -> <e> a) -> <e> a
+    catch :: VecComp ex => (<e,Exception> a) -> (ex -> <e> a) -> <e> a
 
 importJava "java.lang.Throwable" where
     data Throwable