Open marcprux opened 3 months ago
Test case FeatureSupportTests.testExtendArrayShouldImportArray()
This should now be fixed in skip 0.8.50. Use File->Packages->Update to Latest to get the latest transpiler with the fix
Thanks Abe, confirmed working.
Cheers, Ben
If you have a Swift file with just a single extension on
Array
(orCollection
):The resulting Kotlin will not add the explicit
import skip.lib.Array
line, thus resulting in the extension being incorrectly added to thekotlin.Array
, and thereby preventing the extension from being used in the correct way.For example, the above code will result in the
javap -c
bytecode:If the
Array
type is referenced anywhere in the file, then we will add the explicitimport skip.lib.Array
line to the transpiled Kotlin, thereby resulting in the expected compiled code:The symptom will be that the extension will simply not be found in any code that references the extension. The workaround is to simply reference the
Array
type somewhere in the compile unit, which will trigger Skip to add the explicitskip.lib.Array
import. E.g., this will be sufficient: