compiler/TTypechecker.st
changeset 13 97090c2baa33
parent 11 6d39860d0fdb
child 14 fa42d3f1a578
--- a/compiler/TTypechecker.st	Fri Sep 18 06:20:53 2015 +0100
+++ b/compiler/TTypechecker.st	Sun Sep 20 12:01:42 2015 +0100
@@ -9,6 +9,19 @@
 	category:'Languages-Tea-Compiler-Internals'
 !
 
+!TTypechecker methodsFor:'visiting'!
+
+visitArgument: anRBVariableNode
+    | binding |
+
+
+    super visitArgument: anRBVariableNode.
+    binding := anRBVariableNode binding.
+    binding type: (anRBVariableNode typeSpec asType)
+
+    "Created: / 20-09-2015 / 07:19:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !TTypechecker methodsFor:'visitor-double dispatching'!
 
 acceptIfTrueIfFalseNode: node
@@ -38,6 +51,24 @@
     "Created: / 14-09-2015 / 14:18:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+acceptLiteralNode: aLiteralNode
+    | binding value |
+
+    binding := aLiteralNode binding.
+    value := binding value.
+    value isInteger ifTrue:[ 
+        binding type: (context environment binding lookupClassSIntegerW) type.
+        ^ self
+    ].
+    value isBoolean ifTrue:[ 
+        binding type: (context environment binding lookupClassBoolean) type.
+        ^ self.
+    ].
+    context reportTypeError: 'Unsupported constant type'.
+
+    "Created: / 20-09-2015 / 07:13:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 acceptMessageNode: aMessageNode 
     | receiverType receiverBinding methodBinding |