mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 12:40:11 +03:00
Report correct location for undefined identifiers in function return types (#21223)
This commit is contained in:
parent
5fcca3e152
commit
d657667ff8
4 changed files with 13 additions and 3 deletions
|
@ -181,7 +181,7 @@ private void resolveHelper(TypeQualified mt, Loc loc, Scope* sc, Dsymbol s, Dsym
|
|||
(id == Id._super && sc.getClassScope()))
|
||||
error(loc, "undefined identifier `%s`, did you mean `typeof(%s)`?", p, p);
|
||||
else
|
||||
error(loc, "undefined identifier `%s`", p);
|
||||
error(mt.loc, "undefined identifier `%s`", p);
|
||||
}
|
||||
else {
|
||||
if (const n = cIncludeHint(id.toString()))
|
||||
|
|
|
@ -4,7 +4,7 @@ TEST_OUTPUT:
|
|||
fail_compilation/b23686.d(107): Error: undefined identifier `eFN1`, did you mean template `eFN0()()`?
|
||||
fail_compilation/b23686.d(107): Error: `mixin(_error_)` does not give a valid type
|
||||
fail_compilation/b23686.d(115): while looking for match for `eload!(int, 1)`
|
||||
fail_compilation/b23686.d(121): Error: undefined identifier `FNwtf`
|
||||
fail_compilation/b23686.d-mixin-121(121): Error: undefined identifier `FNwtf`
|
||||
fail_compilation/b23686.d(121): Error: `mixin(_error_)` does not give a valid type
|
||||
fail_compilation/b23686.d(126): while looking for match for `load!"wtf"`
|
||||
---
|
||||
|
|
10
compiler/test/fail_compilation/fix21165.d
Normal file
10
compiler/test/fail_compilation/fix21165.d
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fix21165.d(9): Error: undefined identifier `foo`
|
||||
---
|
||||
*/
|
||||
|
||||
// Test case from Issue #21165
|
||||
foo
|
||||
f() {}
|
|
@ -117,7 +117,7 @@ TEST_OUTPUT:
|
|||
---
|
||||
fail_compilation/noreturn2.d(130): Error: cannot create instance of interface `I`
|
||||
fail_compilation/noreturn2.d(133): Error: can only throw class objects derived from `Throwable`, not type `int[]`
|
||||
fail_compilation/noreturn2.d(138): Error: undefined identifier `UnkownException`
|
||||
fail_compilation/noreturn2.d(139): Error: undefined identifier `UnkownException`
|
||||
---
|
||||
+/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue