aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-11-18 14:48:54 +0000
committerMichael Williamson <mike@zwobble.org>2023-11-18 14:48:54 +0000
commit686fe85364d87aa995bf080ea934674a2ece35d9 (patch)
tree1f41fc295823b11d48e200c18bf8fbe0c30bae94 /src/main/java
parent240cf4b6b2c4135d9b6b9150426798f6cc8508df (diff)
Generate stack IR for effect field access
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");
};