Bug 8251 – Property function call without parenthesis fails when it's passed as template argument

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-16T09:39:00Z
Last change time
2012-10-07T11:53:10Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
tommitissari

Comments

Comment #0 by tommitissari — 2012-06-16T09:39:21Z
template MyValue(int value) { int MyValue = value; } struct MyStruct { static @property int min() { return 123; } } @property int globalMin() { return 456; } int main(string[] argv) { static assert(MyStruct.min == 123); // #0: OK static assert(globalMin == 456); // #1: OK int a = MyValue!(MyStruct.min()); // #2: OK int b = MyValue!(globalMin()); // #3: OK int c = MyValue!(MyStruct.min); // #4 int d = MyValue!(globalMin); // #5 return 0; } // #4: Error: template instance MyValue!(min) MyValue!(min) // does not match template declaration MyValue(int value) // #5: Error: template instance MyValue!(globalMin) MyValue!(globalMin) // does not match template declaration MyValue(int value)
Comment #1 by k.hara.pg — 2012-06-16T10:57:11Z
Comment #2 by github-bugzilla — 2012-10-07T10:59:50Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8e8751cdc5a7f24c8224c754d16b80025a51a7fb fix Issue 8251 - Property function call without parenthesis fails when it's passed as template argument https://github.com/D-Programming-Language/dmd/commit/f4ec500d57e53dde1fe5ce6091dec52ae649b044 Merge pull request #599 from 9rnsr/fix7174 Issue 7174,7274,7275,8251 - Cannot use property function call in some where
Comment #3 by yebblies — 2012-10-07T11:53:10Z