mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 04:33:45 +03:00
[ error ] Add an FC to record constructors for better error messages (#2769)
This commit is contained in:
parent
d1e1d0636c
commit
ea733181c5
@ -129,7 +129,7 @@ elabRecord {vars} eopts fc env nest newns vis mbtot tn_in params opts conName_in
|
||||
let conty = mkTy paramTelescope $
|
||||
mkTy (map farg fields) (recTy tn)
|
||||
let boundNames = paramNames ++ map fname fields ++ vars
|
||||
let con = MkImpTy EmptyFC EmptyFC cname
|
||||
let con = MkImpTy (virtualiseFC fc) EmptyFC cname
|
||||
!(bindTypeNames fc [] boundNames conty)
|
||||
let dt = MkImpData fc tn !(bindTypeNames fc [] boundNames (mkDataTy fc params)) opts [con]
|
||||
log "declare.record" 5 $ "Record data type " ++ show dt
|
||||
|
@ -93,7 +93,7 @@ idrisTestsError = MkTestPool "Error messages" [] Nothing
|
||||
"perror001", "perror002", "perror003", "perror004", "perror005",
|
||||
"perror006", "perror007", "perror008", "perror009", "perror010",
|
||||
"perror011", "perror012", "perror013", "perror014", "perror015",
|
||||
"perror016", "perror017", "perror018", "perror019"]
|
||||
"perror016", "perror017", "perror018", "perror019", "perror020"]
|
||||
|
||||
idrisTestsInteractive : TestPool
|
||||
idrisTestsInteractive = MkTestPool "Interactive editing" [] Nothing
|
||||
|
5
tests/idris2/perror020/Issue2769.idr
Normal file
5
tests/idris2/perror020/Issue2769.idr
Normal file
@ -0,0 +1,5 @@
|
||||
module Issue2769
|
||||
|
||||
record SomeRecord where
|
||||
constructor SomeRecord
|
||||
field : Int
|
8
tests/idris2/perror020/expected
Normal file
8
tests/idris2/perror020/expected
Normal file
@ -0,0 +1,8 @@
|
||||
1/1: Building Issue2769 (Issue2769.idr)
|
||||
Error: Issue2769.SomeRecord is already defined.
|
||||
|
||||
Issue2769:3:1--5:14
|
||||
3 | record SomeRecord where
|
||||
4 | constructor SomeRecord
|
||||
5 | field : Int
|
||||
|
3
tests/idris2/perror020/run
Normal file
3
tests/idris2/perror020/run
Normal file
@ -0,0 +1,3 @@
|
||||
rm -rf build
|
||||
|
||||
$1 --no-banner --no-color --console-width 0 --check Issue2769.idr
|
Loading…
Reference in New Issue
Block a user