Skip to content

Const declarations aren't typechecked #899

Closed
@jruderman

Description

@jruderman
const i: str = 10;
fn main() { log i; }

Should give an error in typeck, but instead it gets to LLVM, which says

Assertion failed: (InitVal->getType() == getType()->getElementType() && "Initializer type must match GlobalVariable type"), function setInitializer, file Globals.cpp, line 168.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions