Bug 8259 – AssociativeArray seen through with alias parameter and UFCS

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-17T10:28:00Z
Last change time
2012-06-20T04:28:41Z
Assigned to
nobody
Creator
doob

Comments

Comment #0 by doob — 2012-06-17T10:28:26Z
The following code shows that depending on how a function is called, UFCS or regular syntax, the type of T is inferred differently. If I remove the alias parameter the code behaves as expected. string foo (alias p, T) (T t) { return typeof(t).stringof; } void main () { string[string] aa; auto x = foo!(3 > 4)(aa); auto y = aa.foo!(3 > 4); assert(x == y); writeln("x=", x); writeln("y=", y); } In the above code the assert is triggered. If I remove the assert the code prints: x=string[string] y=AssociativeArray!(string,string)
Comment #1 by k.hara.pg — 2012-06-20T00:35:11Z
Works in 2.060head.
Comment #2 by doob — 2012-06-20T04:28:41Z
I does, cool.