Skip to content

Commit 0f06c03

Browse files
committed
fix Issue 21622 - Ambiguous template instantiation without parens crashes compiler
When a template instantiation matches multiple overloads exactly but is not called with parentheses, the compiler generated a ScopeExp that fell through sideeffect.d. This fix detects if a ScopeExp resolves to a TemplateInstance with no matching aliasdecl or an OverloadSet, and correctly reports the ambiguity instead of crashing.
1 parent 7cc5d67 commit 0f06c03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dmd/sideeffect.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
* Documentation: https://dlang.org/phobos/dmd_sideeffect.html
99
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/sideeffect.d
1010
*/
11+
1112
module dmd.sideeffect;
13+
1214
import dmd.dtemplate;
1315
import dmd.dsymbol;
1416
import dmd.astenums;

0 commit comments

Comments
 (0)