Skip to content

Matching of qualified names #10

Open
@pepeiborra

Description

@pepeiborra

When asked to unfold a function foo defined in module A, currently retrie will ignore qualified occurrences of foo. I would expect that these occurrences would be unfolded too.
Test case:

-u Qualified.foo
===
 module Qualified where

 foo :: Int -> Int
 foo x = x - x

-quux y = Qualified.foo y
+quux y = y - y

Results in:

Test suite test: RUNNING...
retrie
  golden
    Qualified:    
============================================================
Original:
============================================================
module Qualified where

foo :: Int -> Int
foo x = x - x

quux y = Qualified.foo y

============================================================
Expected:
============================================================
module Qualified where

foo :: Int -> Int
foo x = x - x

quux y = y - y

============================================================
Got:
============================================================
module Qualified where

foo :: Int -> Int
foo x = x - x

quux y = Qualified.foo y

============================================================
Diff:
============================================================
6c6
< quux y = y - y
---
> quux y = Qualified.foo y

============================================================


FAIL
      Exception: HUnitFailure (Just (SrcLoc {srcLocPackage = "main", srcLocModule = "Golden", srcLocFile = "tests/Golden.hs", srcLocStartLine = 119, srcLocStartCol = 7, srcLocEndLine = 119, srcLocEndCol = 43})) (Reason "file contents differ")
  parseQualified: OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions