[Issue 21505] Function alias reported as conflicting function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 31 09:10:06 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21505

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #12053 "Fix duplicate function detection for overloads
introduced by aliases" was merged into stable:

- 487e32082ebe51abee747200e4071b4f58b35957 by MoonlightSentinel:
  Fix 21505 - Rework duplicate function detection without mangling

  The previous implementation compared small parts of the function mangling
  to detect duplicate functions. This approach had several flaws manifesting
  in the referenced issue as well as other false positives for (static)
  members, `alias`ing into different scopes, ... .

  Issue 21505 was caused by the assumption that all functions visited by
  `overloadApply` have the same name. This doesn't hold for overloads
  introduced by an `alias`.

  A reliable mangling-based implementation would need to compare most of
  the mangled name while also omitting severel aspects e.g. the return type
  to detect `int foo()` and `void foo()`.

  Hence the current implementation was replaced by actually comparing the
  `FuncDeclaration`s because it allows for more fine grained checks (and
  also should save some memory allocations).

https://github.com/dlang/dmd/pull/12053

--


More information about the Digitalmars-d-bugs mailing list