Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 19201 - func called with argument types (ulong) matches both: __c_long and __c_ulong #8632

Merged
merged 1 commit into from Aug 28, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
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
@@ -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);
}