2 ms·
1. Type guessing: - if you have a "class Token" and later do "var token", the type is guessed by name affinity. - if you do: token = .getToken() othe
by lucio 13y ago
1. Type guessing:
- if you have a "class Token" and later do "var token", the type is guessed by name affinity.
- if you do:
token = .getToken()
other = token
the type of "other" is guessed from assignment (:Token)
2. Type annotations: you directly state type
var other:Token
var read: Token array
The compiler does a "pseudo-execution" of the AST, guessing types and validating property access.