Unfortunately we don't have any complete symbol equality test in the compiler (even __traits(isSame) doesn't completely work), so fixing this bug is a bit out of scope.
Comment #3 by doob — 2016-04-02T11:49:51Z
I guess since this is currently only a deprecation it isn't _that_ bad. Would it be realistic to fix the bug before it's turned in to a real error?
What is considered equality for a symbol, the fully qualified name? Can that be used instead of comparing identity?
Is there a workaround that I can use?
Comment #4 by code — 2016-04-05T20:41:46Z
(In reply to Jacob Carlborg from comment #3)
> I guess since this is currently only a deprecation it isn't _that_ bad.
> Would it be realistic to fix the bug before it's turned in to a real error?
We'll remove the option when the old import rules have been deprecated.
But sure we can try to add it later, in particular b/c __traits(isSame) doesn't work either.
> What is considered equality for a symbol, the fully qualified name? Can that
> be used instead of comparing identity?
Comparing overload sets is a bit more complex, they are created during lookup and depend on the imported modules.
> Is there a workaround that I can use?
None that I'm aware of.
Comment #5 by k.hara.pg — 2016-04-17T15:44:31Z
I found a minimal test case to be able to see the message "Deprecation: local import search method found overloadset ... instead of overloadset ..."
template Mix15857(T)
{
void foo15857(T) {}
}
mixin Mix15857!int;
mixin Mix15857!string;
void test15857()
{
foo15857(1);
}
(This is using template mixin instead of module import to reduce test files)
However yet I'm not sure it will actually fix the original problem.
https://github.com/dlang/dmd/pull/5681
Comment #6 by github-bugzilla — 2016-04-17T21:45:12Z
(In reply to Jacob Carlborg from comment #8)
> This is not fixed in v2.071.1-b2.
Are you sure? The merge is in v2.071.1-b1.
Comment #10 by doob — 2016-08-12T07:02:36Z
(In reply to Martin Nowak from comment #9)
> (In reply to Jacob Carlborg from comment #8)
> > This is not fixed in v2.071.1-b2.
>
> Are you sure? The merge is in v2.071.1-b1.
I can give it another try.
Comment #11 by doob — 2016-08-12T09:19:07Z
(In reply to Martin Nowak from comment #9)
> (In reply to Jacob Carlborg from comment #8)
> > This is not fixed in v2.071.1-b2.
>
> Are you sure? The merge is in v2.071.1-b1.
The issue persists with both 2.071.1 and 2.071.2-b2. The code base has gone through some major changes but I still get this error:
clang/TranslationUnit.d(112,16): Deprecation: local import search method found overloadset clang.TranslationUnit.toD instead of overloadset clang.TranslationUnit.toD
clang/TranslationUnit.d(266,42): Deprecation: local import search method found overloadset clang.TranslationUnit.toD instead of overloadset clang.TranslationUnit.toD
clang/TranslationUnit.d(267,50): Deprecation: local import search method found overloadset clang.TranslationUnit.toD instead of overloadset clang.TranslationUnit.toD
Comment #14 by github-bugzilla — 2016-09-16T22:04:16Z
Commits pushed to stable at https://github.com/dlang/dmdhttps://github.com/dlang/dmd/commit/c5822394c89c98a8855302164433acf6db09208b
fix Issue 15857 - incorrect checkimports mismatch for overloadsets
- properly fix Issue 15857 by comparing overload sets for equality
(see 082e1199c258e99f7867ca33509db9ae9a31f3ae or #5681 for the previous fix)
- caching them in the local symbol table doesn't fully fix the issue b/c the
table is not checked w/ SearchImportsOnly (see added test case)
- also with -transition=checkimports adding an overload set to the local
symbol table will return that overload set for locals only searches,
even though it might contain imported overloads (see readded dip22e deprecation)
- might still make sense to correctly cache overload sets at some point,
but they shouldn't be that common
https://github.com/dlang/dmd/commit/9ef10b73175ffb5ba6c638eef77bcdb243115026
Merge pull request #6136 from MartinNowak/fix15857
fix Issue 15857 - incorrect checkimports mismatch for overloadsets
Comment #15 by github-bugzilla — 2016-09-27T04:01:25Z