aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/ast/MethodNode.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-03-09 18:11:17 +0000
committerMichael Williamson <mike@zwobble.org>2016-03-09 18:11:17 +0000
commit20dc1e124d606cf4298d5112b6d3c4f6c74e9b68 (patch)
tree47914e8b0356b2f40e3723eae650d3bb6f100dd4 /src/main/java/org/zwobble/couscous/ast/MethodNode.java
parent8ac6cb16b727b5e3d28ab89fee1d169a4f74d9a1 (diff)
Introduce Type interface
Diffstat (limited to 'src/main/java/org/zwobble/couscous/ast/MethodNode.java')
-rw-r--r--src/main/java/org/zwobble/couscous/ast/MethodNode.java13
1 files changed, 7 insertions, 6 deletions
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<FormalArgumentNode> arguments =
ImmutableList.builder();
- private TypeName returnType = UnitValue.REF;
+ private Type returnType = UnitValue.REF;
private final ImmutableList.Builder<StatementNode> 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<FormalArgumentNode> arguments,
- TypeName returnType,
+ Type returnType,
Optional<List<StatementNode>> 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<FormalArgumentNode> arguments;
- private final TypeName returnType;
+ private final Type returnType;
private final Optional<List<StatementNode>> body;
private MethodNode(
@@ -109,7 +110,7 @@ public class MethodNode implements Node {
boolean isStatic,
String name,
List<FormalArgumentNode> arguments,
- TypeName returnType,
+ Type returnType,
Optional<List<StatementNode>> body)
{
this.annotations = annotations;
@@ -136,7 +137,7 @@ public class MethodNode implements Node {
return arguments;
}
- public TypeName getReturnType() {
+ public Type getReturnType() {
return returnType;
}