Bug 13226 – Symbol is not accessible when using traits or mixin

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-30T14:24:00Z
Last change time
2017-06-26T15:56:14Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
kozzi11

Attachments

IDFilenameSummaryContent-TypeSize
1374bugs.tar.gzsource code exampleapplication/gzip395

Comments

Comment #0 by kozzi11 — 2014-07-30T14:24:43Z
Created attachment 1374 source code example //main.d: import m.f; class A { //class main.A member m is not accessible //mixin(t!(typeof(this), "m")); void m() {}; //here is ok //mixin(t!(typeof(this), "m")); } void main(string[] args){} //m.f module m.f; string t(alias cls, string method)() { import std.traits; static if (isSomeFunction!(__traits(getMember, cls, method))) {} return ""; } But when I put content from m.f into main.d everything works ok. Or even when I change __traits(getMember, cls, method) to cls.m everything works. It also does not work with mixin (mixin("cls.m"))
Comment #1 by k.hara.pg — 2014-07-31T13:04:02Z
Comment #2 by github-bugzilla — 2014-08-03T17:17:45Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5bd0c6d8ed044d0261ac365da42efe08a259f02d fix Issue 13226 - Symbol is not accessible when using traits or mixin https://github.com/D-Programming-Language/dmd/commit/63f7cf30cfe0b3aa05a77aacb27d056cd6dde772 Merge pull request #3841 from 9rnsr/fix13226 Issue 13226 - Symbol is not accessible when using traits or mixin
Comment #3 by k.hara.pg — 2014-11-01T12:11:19Z
*** Issue 13597 has been marked as a duplicate of this issue. ***
Comment #4 by dlang-bugzilla — 2017-06-26T15:56:14Z
*** Issue 13598 has been marked as a duplicate of this issue. ***