Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 25, 2012 [Issue 8894] New: 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8894 Summary: 2.059: Lookup error message has become uninformative Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: andrej.mitrovich@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-25 16:11:17 PDT --- module test; struct Foo { } void main() { Foo f; auto x = f.x; } 2.058: $ dmd test.d test.d(6): Error: no property 'x' for type 'Foo' 2.059: $dmd test.d test.d(6): Error: undefined identifier 'x' Best guess: it's probably related to UFCS changes in 2.059. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 25, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-25 16:17:19 PDT --- (In reply to comment #0) > module test; > struct Foo { } > > void main() > { > Foo f; > auto x = f.x; > } > > 2.058: > $ dmd test.d > test.d(6): Error: no property 'x' for type 'Foo' > > 2.059: > $dmd test.d > test.d(6): Error: undefined identifier 'x' > > Best guess: it's probably related to UFCS changes in 2.059. It seems errors are gagged at this point in "Expression *Type::getProperty(Loc loc, Identifier *ident)" in file mtype.c: if (this != Type::terror) { assert(global.gag); // << passes if (s) error(loc, "no property '%s' for type '%s', did you mean '%s'?", ident->toChars(), toChars(), s->toChars()); else error(loc, "no property '%s' for type '%s'", ident->toChars(), toChars()); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 25, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-25 16:24:25 PDT --- (In reply to comment #1) > It seems errors are gagged at this point in "Expression *Type::getProperty(Loc loc, Identifier *ident)" in file mtype.c: The gagging starts in `DotIdExp::semantic(Scope *sc, int flag)` with a nice comment: /* This would be much better if we added a "hasProperty" method to types, * i.e. the gagging is a bad way. */ // .. Type *t1 = e1->type; unsigned errors = global.startGagging(); e = t1->dotExp(sc, e1, ident); if (global.endGagging(errors)) // if failed to find the property { e1->type = t1; // kludge to restore type e = resolveUFCSProperties(sc, this); } e = e->semantic(sc); return e; So it seems UFCS really is to blame. Type properties are checked first, then UFCS is checked, however if neither of them have a match then we should print out the property error rather than the UFCS error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 26, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-26 12:35:01 PDT --- I've been thinking.. maybe we could change the verrorPrint function to print to a buffer by default, and then print that to stdout/stderr from the caller function when gagging is off, but store the error to the global struct if gagging is on. That way we can recover the previous error messages if resolving UFCS failed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 26, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #4 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-10-26 12:39:14 PDT --- (In reply to comment #3) > I've been thinking.. maybe we could change the verrorPrint function to print to a buffer by default, and then print that to stdout/stderr from the caller function when gagging is off, but store the error to the global struct if gagging is on. That way we can recover the previous error messages if resolving UFCS failed. Essentially the code would then look something like this: Type *t1 = e1->type; unsigned errors = global.startGagging(); e = t1->dotExp(sc, e1, ident); OutBuffer oldErrors; // new if (global.endGagging(errors, &oldErrors)) // new { e1->type = t1; // kludge to restore type errors = global.startGagging(); // new e = resolveUFCSProperties(sc, this); if(global.endGagging(errors)) // new printErrors(&oldErrors); // new } e = e->semantic(sc); return e; "&oldErrors" would be an optional parameter where current errors are stored, as the old errors would be cleared on the call to endGagging. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 09, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #5 from Don <clugdbug@yahoo.com.au> 2012-11-09 03:08:43 PST --- Easy way would be, if errors aren't gagged (so that we care about which error message occurs), to gag the UFCS attempt, and if it fails, make the property call again. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 14, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #6 from Walter Bright <bugzilla@digitalmars.com> 2012-11-13 22:57:15 PST --- https://github.com/D-Programming-Language/dmd/pull/1274 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 10, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #7 from Walter Bright <bugzilla@digitalmars.com> 2012-12-10 04:20:12 PST --- https://github.com/D-Programming-Language/dmd/pull/1361 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 10, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #8 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-10 09:06:22 PST --- *** Issue 9128 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 11, 2012 [Issue 8894] 2.059: Lookup error message has become uninformative | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | http://d.puremagic.com/issues/show_bug.cgi?id=8894 --- Comment #9 from github-bugzilla@puremagic.com 2012-12-10 18:08:28 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a0a63bbf95ab82ed9e599d1641f7bd9968c7a9bb Fixes Issue 8894 - Regression with property lookup error message. https://github.com/D-Programming-Language/dmd/commit/bcbffafa02ea119f383f3a26a1d4ceae088ccdde Merge pull request #1361 from AndrejMitrovic/Fix8894_2 Issue 8894 - Regression with property lookup error message. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation