7f1d43b1d1c5 — Leonard Ritter a month ago
* added `raiseof` in addition to `returnof` to allow querying exception type
1 files changed, 13 insertions(+), 1 deletions(-)

M lib/scopes/core.sc
M lib/scopes/core.sc +13 -1
@@ 3313,7 3313,19 @@ let
                     else
                         hide-traceback;
                         error "function type expected"
-                'return-type T
+                let RT ET = ('return-type T)
+                RT
+    raiseof =
+        make-const-type-property-function
+            fn (T)
+                let T =
+                    if ('function-pointer? T) ('element@ T 0)
+                    elseif ('function? T) T
+                    else
+                        hide-traceback;
+                        error "function type expected"
+                let RT ET = ('return-type T)
+                ET
     offsetof =
         spice-macro
             fn (args)