From 20dc1e124d606cf4298d5112b6d3c4f6c74e9b68 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 9 Mar 2016 18:11:17 +0000 Subject: Introduce Type interface --- src/main/java/org/zwobble/couscous/ast/MethodNode.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/zwobble/couscous/ast/MethodNode.java') diff --git a/src/main/java/org/zwobble/couscous/ast/MethodNode.java b/src/main/java/org/zwobble/couscous/ast/MethodNode.java index 4909093..8589eb1 100644 --- a/src/main/java/org/zwobble/couscous/ast/MethodNode.java +++ b/src/main/java/org/zwobble/couscous/ast/MethodNode.java @@ -1,6 +1,7 @@ package org.zwobble.couscous.ast; import com.google.common.collect.ImmutableList; +import org.zwobble.couscous.ast.types.Type; import org.zwobble.couscous.ast.visitors.NodeMapper; import org.zwobble.couscous.ast.visitors.NodeTransformer; import org.zwobble.couscous.values.UnitValue; @@ -27,7 +28,7 @@ public class MethodNode implements Node { private final String name; private final ImmutableList.Builder arguments = ImmutableList.builder(); - private TypeName returnType = UnitValue.REF; + private Type returnType = UnitValue.REF; private final ImmutableList.Builder body = ImmutableList.builder(); @@ -60,7 +61,7 @@ public class MethodNode implements Node { return this; } - public Builder returns(TypeName returnType) { + public Builder returns(Type returnType) { this.returnType = returnType; return this; } @@ -91,7 +92,7 @@ public class MethodNode implements Node { boolean isStatic, String name, List arguments, - TypeName returnType, + Type returnType, Optional> body) { return new MethodNode(annotations, isStatic, name, arguments, returnType, body); @@ -101,7 +102,7 @@ public class MethodNode implements Node { private final boolean isStatic; private final String name; private final List arguments; - private final TypeName returnType; + private final Type returnType; private final Optional> body; private MethodNode( @@ -109,7 +110,7 @@ public class MethodNode implements Node { boolean isStatic, String name, List arguments, - TypeName returnType, + Type returnType, Optional> body) { this.annotations = annotations; @@ -136,7 +137,7 @@ public class MethodNode implements Node { return arguments; } - public TypeName getReturnType() { + public Type getReturnType() { return returnType; } -- cgit v1.2.3