Bug 16417 – override non-inout with inout

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-08-23T09:03:10Z
Last change time
2024-12-13T18:49:36Z
Keywords
spec
Assigned to
No Owner
Creator
Lodovico Giaretta
Moved to GitHub: dmd#19175 →

Comments

Comment #0 by lodovico — 2016-08-23T09:03:10Z
For example, T get() should be overridable with inout(T) get() inout as the latter expands to T get() const(T) get() const immutable(T) get() immutable Other examples: T get(T) can be overridden by inout(T) get(T) inout or inout(T) get(inout T) const(T) get(T) const by inout(T) get(T) inout but not inout(T) get(inout T) inout So, an inout method should be able to override a non-inout method if and only if all occurrences of inout in the overrider correspond to occurrences of the same mutability modifier in the overrided method.
Comment #1 by robert.schadek — 2024-12-13T18:49:36Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19175 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB