Paul SOUTEYRAT
08/11/2021, 9:14 PMinline
functions in Kotlin JS, and I saw that they are not really compiled as-is and that defineInlineFunction
is used instead. Therefore, I am wondering, what's the purpose of defineInlineFunction
? And is there any way to have a real inline
in Kotlin JS (with an annotation for instance) ?
PS: I am using the legacy JS compiler, is this behavior different in IR ?Robert Jaros
08/11/2021, 9:38 PMbashor
08/12/2021, 9:03 AMdefineInlineFunction
is a marker to help compiler to find function for inline to use-site.Paul SOUTEYRAT
08/12/2021, 10:21 AMPaul SOUTEYRAT
08/12/2021, 10:27 AMmyTestVal = myInlineFun$lambda(myTestVal$lambda);
which is not the behavior I expect. This matters to me because I would like to have react functional components with the right type.name (defined by the JS variable name). And my usage works when I am copy/pasting my code strictly (because the name of the variable is correct) but not when using an inline function. Any idea on what I am doing wrong ? Or misunderstood ?bashor
08/12/2021, 1:47 PMPaul SOUTEYRAT
08/12/2021, 2:27 PMPaul SOUTEYRAT
08/12/2021, 2:27 PMPaul SOUTEYRAT
08/12/2021, 2:29 PMPaul SOUTEYRAT
08/12/2021, 2:31 PMAnonymous
(using React Components) and with the second snippet I have a type name myReactFunctionalComponent$lambda
(which is easier to work with).bashor
08/12/2021, 3:52 PMSupport for crossinline should fix this issue for me. Is crossinline supported in IR ?yes, but names and layout could be different
Paul SOUTEYRAT
08/12/2021, 3:53 PM