diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-25 11:42:18 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-25 12:07:37 +0000 |
| commit | 32420dc979cfeaa905f78b84f43b58af09ea3984 (patch) | |
| tree | a35faaf8de40e69bcd5ce0290ae0fc6b08bb156f /src/main/java | |
| parent | d4c714a248602ec48b4ad4cb531d2e335f7e51d0 (diff) | |
Add type substitution for tuples
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/types/TypeSubstitution.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/shedlang/compiler/types/TypeSubstitution.java b/src/main/java/org/shedlang/compiler/types/TypeSubstitution.java index bd679292..e08b859e 100644 --- a/src/main/java/org/shedlang/compiler/types/TypeSubstitution.java +++ b/src/main/java/org/shedlang/compiler/types/TypeSubstitution.java @@ -33,9 +33,11 @@ public class TypeSubstitution { case TopType topType -> type; - case TupleType tupleType -> { - throw new UnsupportedOperationException("TODO"); - } + case TupleType tupleType -> new TupleType( + tupleType.elements().stream() + .map(element -> substitute(element, map)) + .toList() + ); case TypeLevelValueType typeLevelValueType -> { throw new UnsupportedOperationException("TODO"); |
