D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10361 - Cross-module overloading conflict between unordered functions
Summary: Cross-module overloading conflict between unordered functions
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 22:37 UTC by Tommi
Modified: 2024-12-13 18:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tommi 2013-06-14 22:37:45 UTC
It seems that during function partial ordering the compiler thinks that an int-based enum is implicitly convertible to char:

---------
module a;

void foo(char) { }

---------
module b;

enum MyEnum : int { _ }

void foo(MyEnum) { }

---------
module main;

import a;
import b;

void main()
{
    foo(char.init);
    foo(MyEnum.init); // [1]
}

// 1) Error: b.foo at b.d(5) conflicts with a.foo at a.d(3)
Comment 1 yebblies 2013-11-21 04:07:37 UTC
MyEnum.init _is_ convertible to char, because it is known at compile time, and range propagation allow the conversion.
Comment 2 dlangBugzillaToGithub 2024-12-13 18:08:09 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17592

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB