Skip to content

Instantly share code, notes, and snippets.

@UplinkCoder
Created July 26, 2016 21:01
Show Gist options
  • Save UplinkCoder/ca2da4abc3c4891ed0d8ef3cf093ea7e to your computer and use it in GitHub Desktop.
Save UplinkCoder/ca2da4abc3c4891ed0d8ef3cf093ea7e to your computer and use it in GitHub Desktop.
diff --git a/src/dtemplate.d b/src/dtemplate.d
index d90d25c..d3c1587 100644
--- a/src/dtemplate.d
+++ b/src/dtemplate.d
@@ -7943,8 +7943,8 @@ extern (C++) class TemplateInstance : ScopeDsymbol
Declaration d = sa.isDeclaration();
if ((td && td.literal) || (ti && ti.enclosing) || (d && !d.isDataseg() && !(d.storage_class & STCmanifest) && (!d.isFuncDeclaration() || d.isFuncDeclaration().isNested()) && !isTemplateMixin()))
{
- // if module level template
- if (isstatic)
+ // if module level template or if nestedFunction does not need a context
+ if (isstatic || (d.isFuncDeclaration() && !d.isFuncDeclaration().isNested()))
{
Dsymbol dparent = sa.toParent2();
if (!enclosing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment