Bug 18151 – wrong auto ref lvalue inference for implicitly converted alias this parameters

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-01-02T20:02:59Z
Last change time
2024-12-13T18:55:57Z
Keywords
pull
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#19359 →

Comments

Comment #0 by code — 2018-01-02T20:02:59Z
cat > bug.d << CODE void test()(auto ref Inner inner) { pragma(msg, __traits(isRef, inner) ? "ref" : "value"); } struct Inner { } struct Outer { Inner inner; Inner get() { return inner; } alias get this; } void bug() { Outer outer; test(outer); } CODE dmd -c bug.d ---- ref bug.d(20): Error: outer.get() is not an lvalue ---- Happens apparently because auto ref is resolved before implicit alias this conversion kicks in.
Comment #1 by dlang-bot — 2023-05-09T13:12:18Z
@RazvanN7 created dlang/dmd pull request #15214 "Fix Issue 18151 - wrong auto ref lvalue inference for implicitly converted alias this parameters" fixing this issue: - Fix Issue 18151 - wrong auto ref lvalue inference for implicitly converted alias this parameters https://github.com/dlang/dmd/pull/15214
Comment #2 by robert.schadek — 2024-12-13T18:55:57Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19359 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB