Feature request: fun(dataclass) -> funclass

Hi there
Got myself on point tgat
beginDrag(DragData(this,View(),“asd”,“ad”)) - probably might be beginDrag(this,View(),“asd”,“ad”)

and generalize it class Foo(“params”) + fun foo(param:Foo) => foo(“Foo constructior params”)

This would make the overload resolution quite a bit more complicated with very little visible benefit. If you want your users to pass parameters separately, create an overload that takes them separately.

1 Like

Yeh i understand that it will be complex. Point was to provide it as fetrure
for example visual it might be represented as
foo(DataClassName[ params ]) - so user see that it is not direct call
ofc we all can define func with same params and redirect, anyway - ty for your attention

There is a similar change request in YouTrack: https://youtrack.jetbrains.com/issue/KT-15471 If implemented, then it would let you do what you wanted, albeit the overall motivation is slightly more involved, i.e. aimed at a more complex use-case than yours.