Skip to content

Const declarations aren't typechecked #899

@jruderman

Description

@jruderman
Contributor
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.

Activity

added a commit that references this issue on Apr 10, 2015
added a commit that references this issue on Mar 7, 2023
added a commit that references this issue on Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @marijnh@jruderman

        Issue actions

          Const declarations aren't typechecked · Issue #899 · rust-lang/rust