Skip to content

Capturing an untyped number can break type inference #6387

Open
@bhansconnect

Description

@bhansconnect

Compiling this will create invalid llvm ir:

app "helloWorld"
    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.7.1/Icc3xJoIixF3hCcfXrDwLCu4wQHtNdPyoJkEbkgIElA.tar.br" }
    imports [pf.Stdout, pf.Task]
    provides [main] to pf

main =
    a = 7

    {} <- Stdout.line "Hello, World!" |> Task.await

    b = takesF32 a

    Stdout.line "\(Num.toStr b)"

takesF32 : F32 -> F32
takesF32 = \x -> x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode genGenerating machine codetype checkingRelates to type checking compiler stage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions