Skip to content

Can't use an operator shadowed by a variable of the same name as the aliasee #2803

@no-longer-on-githu-b

Description

@no-longer-on-githu-b
f :: Int -> Int -> Int
f = (+)

infixl 6 f as %

g :: Int -> Int -> Int
g a b = let f = (-) in a % b

Should be functionally equivalent to:

f :: Int -> Int -> Int
f = (+)

infixl 6 f as %

g :: Int -> Int -> Int
g = f

Instead, I get the error:

  Value f is undefined.

while inferring the type of f
in value declaration g

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions