-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix locations in Internal hole substitution (only for the case of sub…
…stituting identifiers) (#2995) Type checking messes up the locations by substituting the holes (instance holes and ordinary holes) without adjusting the location of the expression substituted into the hole. Instead, the location of the expression substituted into the hole is preserved. This messes up locations in type-checked Internal, because the substituted expressions can come from anywhere. Later on, the error locations are wrong in Core, and get wrongly displayed e.g. for pattern matching coverage errors. This PR implements a partial solution for the (most common) case when the substituted expression is an identifier. In the future, we should have a general solution to preserve the hole locations.
- Loading branch information
Showing
10 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Juvix.Compiler.Internal.Data.TypedIden where | ||
|
||
import Juvix.Compiler.Internal.Language | ||
import Juvix.Prelude | ||
|
||
data TypedIden = TypedIden | ||
{ _typedIden :: Iden, | ||
_typedIdenType :: Expression | ||
} | ||
deriving stock (Data, Generic) | ||
|
||
makeLenses ''TypedIden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters