Skip to content

Typechecker panics on qualified associated function from imported module #9638

@rtfeldman

Description

@rtfeldman

The type checker panics when checking a qualified call to an associated function imported from a module that uses the deprecated module [...] header form.

Minimal repro:

# A.roc
module [f]

T := [].{
    f = |x| x
}
# Main.roc
module [main]

import A

main = A.f({})

Run:

roc check --no-cache Main.roc

Expected: roc check should either accept the program or report a normal diagnostic.

Actual: the compiler panics:

thread ... panic: reached unreachable code
src/canonicalize/NodeStore.zig:3077:21: getDef
src/check/Check.zig:7506:40: patternIdentInModule
src/check/Check.zig:7175:47: exprIsBuiltinStrInspect
src/check/Check.zig:7149:50: validateToInspectMethodTypes
src/check/Check.zig:2217:42: checkFileInternal

Confirmed on a detached origin/main worktree at d66ca78f6e5d after rebuilding with zig build roc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions