aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/shedlang/compiler/stackir/StackCompiler.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java b/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java
index 4ca4de8e..8110e6da 100644
--- a/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java
+++ b/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java
@@ -190,6 +190,14 @@ public class StackCompiler {
case StructType structType ->
new FieldLoadInstruction.Receiver.Struct(structType);
+ case TypeLevelValueType typeLevelValueType -> {
+ if (typeLevelValueType.value() instanceof UserDefinedEffect effect) {
+ yield new FieldLoadInstruction.Receiver.Effect(effect);
+ } else {
+ throw new RuntimeException("not a type with fields");
+ }
+ }
+
default ->
throw new RuntimeException("not a type with fields");
};