diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-10-08 11:07:38 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-10-08 11:07:38 +0100 |
| commit | c759fe0cbe348d2d6e69df6e8995ae6bb1a9a5a5 (patch) | |
| tree | 7666bfc75bc352f268df3e9ad28f1b41422729be /src/main/java | |
| parent | 98a15ae8e3836caf9b2bc1a880a79b47b7c45359 (diff) | |
Support iteration through struct types
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java b/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java index 5dc01ae7..f18b8836 100644 --- a/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java +++ b/src/main/java/org/shedlang/compiler/typechecker/TypeInfos.java @@ -7,6 +7,7 @@ import org.shedlang.compiler.types.*; import org.shedlang.compiler.util.P; import java.util.Optional; +import java.util.Set; public class TypeInfos { public static final TypeInfos EMPTY = new TypeInfos(Empty.map(), P.orderedPMap(), Empty.map()); @@ -55,6 +56,10 @@ public class TypeInfos { return Optional.ofNullable(structTypeInfos.get(type)); } + public Set<StructType> structTypes() { + return structTypeInfos.keySet(); + } + public TypeInfos addSumTypeInfo(SumType sumType, SumTypeInfo sumTypeInfo) { return new TypeInfos( this.namespaceTypeInfos, |
