Skip to content

No longer allowed function parameter names that clash with record field names if accessing that field within the function #441

@jakeelituv

Description

@jakeelituv

Steps to reproduce

record TestRecord where
  constructor MkRec
  n : Int

testFunc : Int -> TestRecord -> Bool
testFunc n testRecord =
    n == testRecord.n

results in:

Mismatch between:
	Int
and
	TestRecord -> ?ty

If instead I rename the parameter in the function to m it compiles

record TestRecord where
  constructor MkRec
  n : Int

testFunc : Int -> TestRecord -> Bool
testFunc m testRecord =
    m == testRecord.n

Alternatively, if I don't ever call the ".n" function the following compiles, even if my function uses n as a parameter:

record TestRecord where
  constructor MkRec
  n : Int

testFunc : Int -> TestRecord -> Bool
testFunc n testRecord =
    n == 2

Expected Behavior

This didn't happen until a commit from a few days ago so I assume this isn't supposed to happen.

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