aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-01-10 20:10:54 +0000
committerMichael Williamson <mike@zwobble.org>2016-01-10 20:10:54 +0000
commite1d8a9727e1a84ddfa5b38e8f8a433b7105bc6bd (patch)
tree698286dde058e0cbdfdf75da9a04c97e2a7f278e /src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java
parentd0e09b193e96f573231254ca60d5a62c65b6d232 (diff)
Implements casts in the interpreter
Diffstat (limited to 'src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java')
-rw-r--r--src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java b/src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java
new file mode 100644
index 0000000..1d89ad1
--- /dev/null
+++ b/src/main/java/org/zwobble/couscous/interpreter/InvalidCast.java
@@ -0,0 +1,22 @@
+package org.zwobble.couscous.interpreter;
+
+import org.zwobble.couscous.ast.TypeName;
+
+public class InvalidCast extends RuntimeException {
+ private final TypeName expected;
+ private final TypeName actual;
+
+ public InvalidCast(TypeName expected, TypeName actual) {
+
+ this.expected = expected;
+ this.actual = actual;
+ }
+
+ public TypeName getExpected() {
+ return expected;
+ }
+
+ public TypeName getActual() {
+ return actual;
+ }
+}