Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/dmd/mtype.d
Original file line number Diff line number Diff line change
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibuclaw These two lines caused regression https://issues.dlang.org/show_bug.cgi?id=19499

}
else
return MATCH.nomatch;
Expand Down
30 changes: 30 additions & 0 deletions test/compilable/test19201.d
Original file line number Diff line number Diff line change
@@ -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);
}