Skip to content

Warn about potentially-confusing uses of function applications in patterns #31

@LPTK

Description

@LPTK

Direct function application syntax on a pattern hole is currently interpreted as higher-order matching. To extract a function, one should ascribe the hole with a function type. This can lead to confusing error, such as the following:

[error] Embedding Error: Unexpected expression in higher-order pattern variable argument: 42
[error]     case ir"$f(42)" => println(s"$f(42)")
[error]          ^

In this case, the error message should inform and guide users who just wanted to extract a function...

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