[Issue 10999] New: Limited type matching
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 9 11:08:39 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10999
Summary: Limited type matching
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: rswhite4 at googlemail.com
--- Comment #0 from rswhite4 at googlemail.com 2013-09-09 11:08:38 PDT ---
Code:
----
import std.stdio;
void foo(short x, short y) { }
void foo(short[2] xy) { }
void main()
{
foo(1, 2); /// works
foo([1, 2]); /// works
ushort[2] xy = [1, 2];
foo(xy); /// fails
ushort x = 1, y = 2;
foo(x, y); /// works
}
----
If the compiler is able to cast implicit from ushort to short, he should also
be able to cast from ushort[2] to short[2].
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list