Bug 16139 – Attributes of functions inside templates should be inferred

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-08T06:05:38Z
Last change time
2024-12-13T18:48:25Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright
Blocks
13615
See also
https://issues.dlang.org/show_bug.cgi?id=13615
Moved to GitHub: dmd#19143 →

Comments

Comment #0 by bugzilla — 2016-06-08T06:05:38Z
This should work for the same reason that template functions get their attributes inferred: template Mine() { void foo() { } } @safe bar() { Mine!().foo(); } dmd test5 test.d(11): Error: safe function 'test.bar' cannot call system function 'test.Mine!().foo'
Comment #1 by bugzilla — 2016-09-14T08:28:03Z
Comment #2 by destructionator — 2022-08-01T23:53:27Z
I just encountered this while confirming a report on the chat room: ``` template A() { void foo() { } auto bar() { } } static assert(is(typeof(A!().foo) == typeof(A!().bar))); ``` Fails today due to this issue. Bizarre.
Comment #3 by robert.schadek — 2024-12-13T18:48:25Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19143 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB