Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of apparent hack affecting (non-allinst) template emission #13731

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/dmd/dsymbolsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -5734,13 +5734,6 @@ void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions*

// Get the instantiating module from the scope minst
tempinst.minst = sc.minst;
// https://issues.dlang.org/show_bug.cgi?id=10920
// If the enclosing function is non-root symbol,
// this instance should be speculative.
if (!tempinst.tinst && sc.func && sc.func.inNonRoot())
{
tempinst.minst = null;
}

tempinst.gagged = (global.gag > 0);

Expand Down Expand Up @@ -5900,7 +5893,10 @@ void templateInstanceSemantic(TemplateInstance tempinst, Scope* sc, Expressions*
override void visit(Dsymbol d)
{
if (d._scope)
{
d._scope.tinst = inst;
d._scope.minst = inst.minst;
}
}

override void visit(ScopeDsymbol sds)
Expand Down