D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3509 - Cannot forward reference a template mixin's members in a compile-time context
Summary: Cannot forward reference a template mixin's members in a compile-time context
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 blocker
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks: 340
  Show dependency treegraph
 
Reported: 2009-11-14 12:29 UTC by Matti Niemenmaa
Modified: 2014-04-18 09:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2009-11-14 12:29:13 UTC
template T(bool b) { static assert (b); }

template Mix() { void f() {} }

class C {
	alias T!(is(typeof(M.f))) U;
	mixin Mix!() M;
}

foo.d(1): Error: static assert  (b) is false


Moving the alias below the mixin makes the code compile.
Comment 1 github-bugzilla 2012-03-12 19:28:22 UTC
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3a45e50f400ad1ec8bb179c95ee39594028a534f
fix Issue 3509 - Cannot forward reference a template mixin's members in a compile-time context
Comment 2 github-bugzilla 2012-03-12 19:28:40 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ebc3fa912b24182aa3204d0b9c49a59bd3d9d85f
fix Issue 3509 - Cannot forward reference a template mixin's members in a compile-time context