Skip to content

Type checker fails to identify type from reference #7273

Open
@anderseknert

Description

@anderseknert

No error reported

package p

a := "foo"
s := sum([1, a])

This should fail as sum only accepts numeric values. However, it doesn't. When the value is used directly, the type checker correctly reports the error.

Error reported

package p

s := sum([1, "foo"])

Playground

Could be that there are more examples where the type isn't correctly inferred — I haven't looked into that. This was just something that I hit when working on Regal this evening.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions