Bug 506 – static import and renamed import of mixin don't work

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-11-14T21:11:00Z
Last change time
2014-02-15T13:21:12Z
Assigned to
bugzilla
Creator
wbaxter

Comments

Comment #0 by wbaxter — 2006-11-14T21:11:55Z
static import and renamed import of a mixin don't work if the mixin itself has imports. This is a continuation of http://d.puremagic.com/issues/show_bug.cgi?id=498 which covers the basic import case. The fix for that however does not fix the static import and renamed import cases (import sigs=std.signals) cases. Here's examples: ------ import sigs=std.signals; class SigObj { mixin sigs.Signal!(); } void main() { } ---- static import std.signals; class SigObj { mixin std.signals.Signal!(); } void main() { }
Comment #1 by bugzilla — 2006-11-26T03:06:23Z
mixins are defined to be evaluated in the scope of where they are mixed in, rather than where they are declared. Hence the behavior you're seeing. To evaluate it in the context where it is declared, use a struct. It's working as designed. To change it, please submit an enhancement request.