Kotlin.Stdlib contains the public class kotlin.io.encoding.Base64 which is not intended to be instantiated by external users. Thus it only contains a private default constructor.
public open class Base64 private constructor (internal val isUrlSafe: Boolean, internal val isMimeScheme: Boolean) {
public companion object Default : Base64(isUrlSafe = false, isMimeScheme = false) { ... }
}
This compiles into the following Java constructors:
Previously we believed that a synthetic default constructor would always end in an int and a DefaultConstructorMarker parameter, however this one does not.
This synthetic constructor causes us to generate some bizarre constructors:
[Register (".ctor", "(ZZLkotlin/jvm/internal/DefaultConstructorMarker;)V", "")]
public unsafe Base64 (bool isUrlSafe, bool isMimeScheme, global::Kotlin.Jvm.Internal.DefaultConstructorMarker? _constructor_marker)
: base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { ... }
This commit extends our Kotlin default constructor marker detection logic to look for any synthetic constructor whose final parameter is DefaultConstructorMarker to handle this additional case.
With the change, Kotlin.IO.Encoding.Base64 no longer generates a public constructor.
Kotlin.Stdlib
contains thepublic
classkotlin.io.encoding.Base64
which is not intended to be instantiated by external users. Thus it only contains aprivate
default constructor.https://github.com/JetBrains/kotlin/blob/3fbb7bc92086bdf3bde123a8f774bce25b19ef37/libraries/stdlib/src/kotlin/io/encoding/Base64.kt
This compiles into the following Java constructors:
Previously we believed that a synthetic default constructor would always end in an
int
and aDefaultConstructorMarker
parameter, however this one does not.https://github.com/xamarin/java.interop/blob/651de42732d194cee5a45fae45feda37706a8c16/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinUtilities.cs#L100-L103
This synthetic constructor causes us to generate some bizarre constructors:
This commit extends our Kotlin default constructor marker detection logic to look for any synthetic constructor whose final parameter is
DefaultConstructorMarker
to handle this additional case.With the change,
Kotlin.IO.Encoding.Base64
no longer generates apublic
constructor.