Skip to content

Commit 04dbae2

Browse files
committed
fixes
1 parent 5b22aa7 commit 04dbae2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

type_check_Ctup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ def check_type_equal(self, t1, t2, e):
1919
+ ' in ' + repr(e))
2020
case _:
2121
super().check_type_equal(t1, t2, e)
22+
23+
def type_check_atm(self, e, env):
24+
match e:
25+
case GlobalValue(name):
26+
return IntType()
27+
case _:
28+
return super().type_check_atm(e, env)
2229

2330
def type_check_exp(self, e, env):
2431
match e:
@@ -29,8 +36,6 @@ def type_check_exp(self, e, env):
2936
return BoolType()
3037
case Allocate(length, typ):
3138
return typ
32-
case GlobalValue(name):
33-
return IntType()
3439
case Subscript(tup, Constant(index), Load()):
3540
tup_t = self.type_check_atm(tup, env)
3641
match tup_t:

0 commit comments

Comments
 (0)