Bug 11860 – with(expr) statement doesn't allow static methods on expr to be called with UFCS

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-02T15:16:45Z
Last change time
2024-12-13T18:15:37Z
Assigned to
No Owner
Creator
Dylan Knutson
Moved to GitHub: dmd#18747 →

Comments

Comment #0 by tcdknutson — 2014-01-02T15:16:45Z
This isn't supported: ``` import std.stdio; void main() { struct MyStruct { static void doIt(string thing) { writeln(thing); } } with(MyStruct) { "print me".doIt(); } } ``` Does it make sense for it to be supported? I've got a use case for it that deals with letting the user supply their own struct with custom static methods on it, with the struct acting as a "wrapper" for loose functions.
Comment #1 by b2.temp — 2020-07-04T17:32:39Z
UFCS on member funcs is not supported, this is not specific to with(). THie issue is rather an ER.
Comment #2 by robert.schadek — 2024-12-13T18:15:37Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18747 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB