[Issue 22540] Instantiation modifies dependant type of value / alias template parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 23 21:16:22 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22540
Dlang Bot <dlang-bot at dlang.rocks> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |pull
--- Comment #1 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MoonlightSentinel created dlang/dmd pull request #13352 "Fix 22540 - Copy
parameter types / defaults of dependant template..." fixing this issue:
- Fix 22540 - Copy parameter types / defaults of dependant template...
... value / alias parameters.
The introduced copies ensure that the initialized parameters of the
instantiation do not share objects with the template declaration.
Previously, sharing could occur in the following scenarios:
- type parameter appears inside of value type, e.g. `foo(T, T* val)`
Later semantic resolves `T` to the concrete type and hence changes
the type of `val` in the template declaration.
- alias parameter default value isn't copied and manifested according to
the first template instance.
https://github.com/dlang/dmd/pull/13352
--
More information about the Digitalmars-d-bugs
mailing list