Comment #0 by dlang-bugzilla — 2020-04-01T03:23:02Z
//////// test.d ////////
pragma(msg, is(typeof({
struct S {
struct Foo {}
struct Bar() {}
alias Bar = Foo;
}
})));
////////////////////////
Compiler output:
test.d(5): Error: undefined identifier `Foo`
false
Introduced in https://github.com/dlang/dmd/pull/10078
Comment #1 by b2.temp — 2020-04-03T17:01:00Z
The problem is that the semantic of the alias is run at the wrong time, i.e the error are not gagged but in the present context they should. The gagging is activated when the IsExp is visited. But the alias sema is run when the overload is inserted.
Comment #2 by b2.temp — 2020-04-03T17:05:28Z
Created attachment 1779
workaround
As officially I dont participate to dlang anymore but also as a commit of mine causes the regression I send a patch.
The fix is not really good but comes with explanations about what was done in first place, i.e for issue 15795. Ideally issue 15795 should be fixed in another way but I remember that I could not find a better way when I made the PR.