nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
syntax: allow untyped variable declaration
[nit.git]
/
src
/
syntax
/
syntax_base.nit
diff --git
a/src/syntax/syntax_base.nit
b/src/syntax/syntax_base.nit
index
512ccf4
..
13e1372
100644
(file)
--- a/
src/syntax/syntax_base.nit
+++ b/
src/syntax/syntax_base.nit
@@
-229,7
+229,12
@@
abstract class Variable
# Declaration AST node
readable var _decl: nullable ANode
# Declaration AST node
readable var _decl: nullable ANode
- # Static type
+ # Is the variable correcly declared
+ # Return false if typed was not yet computed or
+ # if an error occured during the typing computation
+ fun is_typed: Bool do return _stype != null
+
+ # The declaration static type of the variable
readable writable var _stype: nullable MMType
redef fun to_s do return _name.to_s
readable writable var _stype: nullable MMType
redef fun to_s do return _name.to_s