mozilla/rust — Issue #1728: RFC: Handle built-in type names in resolve, rather than parser
Author: marijnh
Created: 2012-02-01 05:57:38+00:00
State: open
Labels: rfc

This was propsed by @brson in #1586 . The parser doesn't need to know about built-in type names like `int`, `f64`, and `bool`. We could create an artificial top-level scope in the resolver that resolves these to the right types. It'd simplify the parser and the AST.

This might also we worth doing for simple value keywords like `true`, `false`, maybe even `log`, which don't influence the syntax around them. I already did it for `self` recently, and that definitely resulted in cleaner code.

Open question is whether shadowing of these would be allowed. I'd be okay with either, but lean slightly towards allowing it, since that makes them behave exactly like other names and removes a special case / error check from the compiler.