Skip to content

RFC: Handle built-in type names in resolve, rather than parser #1728

@marijnh

Description

@marijnh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions