diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-10-30 23:55:19 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-10-30 23:56:10 +0000 |
| commit | 1ef4865a040ae94b69a5c4dabcb5dca837cae67c (patch) | |
| tree | 581f7a0fdc72e616f748333fc5d061c5b1e01fd8 /src/main/java/org/zwobble/couscous/ast/InterfaceNode.java | |
| parent | 62ea20e20ed1c0d6b2564f8fff862d380da15fce (diff) | |
Defer generation of classes for lambdas
Diffstat (limited to 'src/main/java/org/zwobble/couscous/ast/InterfaceNode.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/ast/InterfaceNode.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/InterfaceNode.java b/src/main/java/org/zwobble/couscous/ast/InterfaceNode.java index 6a56a6b..1392aee 100644 --- a/src/main/java/org/zwobble/couscous/ast/InterfaceNode.java +++ b/src/main/java/org/zwobble/couscous/ast/InterfaceNode.java @@ -8,6 +8,7 @@ import org.zwobble.couscous.types.Type; import java.util.List; import java.util.Set; +import static org.zwobble.couscous.util.ExtraLists.concat; import static org.zwobble.couscous.util.ExtraLists.eagerFlatMap; import static org.zwobble.couscous.util.ExtraLists.list; @@ -116,6 +117,15 @@ public class InterfaceNode implements TypeNode { @Override public TypeNode stripInnerTypes() { + return withInnerTypes(list()); + } + + @Override + public TypeNode addInnerTypes(List<TypeNode> types) { + return withInnerTypes(concat(innerTypes, types)); + } + + private TypeNode withInnerTypes(List<TypeNode> types) { return new InterfaceNode( name, typeParameters, @@ -123,7 +133,7 @@ public class InterfaceNode implements TypeNode { fields, staticConstructor, methods, - list() + types ); } |
