Fix bug where the assigned type was not checked in declarations.

This commit is contained in:
Sei Lisa 2014-08-10 00:44:57 +02:00
parent 9cf18ade60
commit 0d81f132ab

View file

@ -1333,7 +1333,7 @@ class parser(object):
decl = {'nt':'DECL','t':typ, 'name':name, 'scope':self.scopeindex}
if self.tok[0] == '=':
self.NextToken()
decl['ch'] = [self.Parse_expression()]
decl['ch'] = [self.autocastcheck(self.Parse_expression(), typ)]
self.expect(';')
self.NextToken()
self.AddSymbol('v', self.scopeindex, name, Type=typ)