--- enum E { i } struct S { bool opCast(T)() { return true; } } void main() { // Error 42: Symbol Undefined bool main.Param.opCast!(bool).opCast() with(E) assert(S()); assert(S()); } ---
The bug is present in 5f033bfd9f7aaf95dade128f50bfc7360bb16215.
https://github.com/D-Programming-Language/dmd/pull/2890
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f8ec8ee7d447c966f8a064a1313b936f6d2adba8 fix Issue 7966 - First template instantiation inside `with` results in `Error 42: Symbol Undefined` Always use `WithScopeSymbol` to make correct chain of `scopesym->parent`. https://github.com/D-Programming-Language/dmd/commit/e0b6a37a6e820d641c3edbf4a467392b8c6adac3 Merge pull request #2890 from 9rnsr/fix7966 Issue 7966 - First template instantiation inside `with` results in `Error 42: Symbol Undefined`