mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-13 10:58:23 +03:00
Show the locations of the definitions when reporting invalid dependencies
We only show the file location as these will always be in the same file, I think.
This commit is contained in:
parent
65cd467741
commit
cb21ab61ba
@ -62,6 +62,12 @@ data DepName = NamedThing Name
|
||||
| ConstratintAt Range -- ^ identifed by location in source
|
||||
deriving (Eq,Ord,Show,Generic,NFData)
|
||||
|
||||
depNameLoc :: DepName -> Range
|
||||
depNameLoc x =
|
||||
case x of
|
||||
NamedThing n -> nameLoc n
|
||||
ConstratintAt r -> r
|
||||
|
||||
|
||||
|
||||
instance PP RenamerError where
|
||||
@ -134,7 +140,9 @@ instance PP RenamerError where
|
||||
|
||||
InvalidDependency ds ->
|
||||
"[error] Invalid recursive dependency:"
|
||||
$$ nest 4 (vcat [ "•" <+> pp x | x <- ds ])
|
||||
$$ nest 4 (vcat [ "•" <+> pp x <+> ", defined at" <+> ppR (depNameLoc x)
|
||||
| x <- ds ])
|
||||
where ppR r = pp (from r) <.> "--" <.> pp (to r)
|
||||
|
||||
instance PP DepName where
|
||||
ppPrec _ d =
|
||||
|
@ -3,4 +3,4 @@ Loading module Cryptol
|
||||
Loading module binarytree
|
||||
|
||||
[error] Invalid recursive dependency:
|
||||
• type binarytree::Tree
|
||||
• type binarytree::Tree , defined at 3:9--3:13
|
||||
|
@ -3,5 +3,5 @@ Loading module Cryptol
|
||||
Loading module T3
|
||||
|
||||
[error] Invalid recursive dependency:
|
||||
• T3::x
|
||||
• submodule T3::A
|
||||
• T3::x , defined at 4:1--4:2
|
||||
• submodule T3::A , defined at 6:11--6:12
|
||||
|
@ -3,5 +3,5 @@ Loading module Cryptol
|
||||
Loading module T9
|
||||
|
||||
[error] Invalid recursive dependency:
|
||||
• T9::x
|
||||
• submodule T9::A
|
||||
• T9::x , defined at 3:1--3:2
|
||||
• submodule T9::A , defined at 5:11--5:12
|
||||
|
@ -52,7 +52,7 @@ Loading module Cryptol
|
||||
Loading module Main
|
||||
|
||||
[error] Invalid recursive dependency:
|
||||
• type Main::T
|
||||
• type Main::T , defined at 1:6--1:7
|
||||
Loading module Cryptol
|
||||
Loading module Main
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user