Skip to content

Commit

Permalink
fix Issue 19201 - func called with argument types (ulong) matches bot…
Browse files Browse the repository at this point in the history
…h: __c_long and __c_ulong
  • Loading branch information
ibuclaw committed Aug 28, 2018
1 parent 05cdf2f commit 9772f49
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dmd/mtype.d
Expand Up @@ -3369,10 +3369,10 @@ extern (C++) final class TypeBasic : Type
EnumDeclaration ed = (cast(TypeEnum)to).sym;
if (ed.isSpecial())
{
/* Special enums that allow implicit conversions to them
* with a MATCH.convert
*/
/* Special enums that allow implicit conversions to them. */
tob = to.toBasetype().isTypeBasic();
if (tob)
return implicitConvTo(tob);
}
else
return MATCH.nomatch;
Expand Down
30 changes: 30 additions & 0 deletions test/compilable/test19201.d
@@ -0,0 +1,30 @@
// https://issues.dlang.org/show_bug.cgi?id=19201
enum __c_long : int;
enum __c_ulong : uint;

enum __c_longlong : long;
enum __c_ulonglong : ulong;

void test19201a(uint r);
void test19201a(int r);

void test19201b(ulong r);
void test19201b(long r);

void test19201c(__c_long r);
void test19201c(__c_ulong r);

void test19201d(__c_longlong r);
void test19201d(__c_ulonglong r);

void test19201()
{
test19201a(0);
test19201a(0u);
test19201b(0L);
test19201b(0UL);
test19201c(0);
test19201c(0u);
test19201d(0L);
test19201d(0UL);
}

0 comments on commit 9772f49

Please sign in to comment.