-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Tools.Bytecode] Kotlin unsigned internal props (#1156)
Context: 6bd7ae4 In commit 6bd7ae4, we updated the logic that matches a Kotlin public property getter/setter to a generated Java getter/setter that follows this pattern: // Kotlin public var type = 0 // Java private int type = 0; public int getType () { ... } public void setType (int p0) { ... } However, this caused unit tests in xamarin/xamarin-android to fail that when using Kotlin unsigned types: KotlinUnsignedTypesTests.cs: error CS0200: Property or indexer 'UnsignedInstanceMethods.UnsignedInstanceProperty' cannot be assigned to -- it is read only This is because properties that use Kotlin unsigned types append a `-<type-hash>` suffix to their getter/setter names: // Kotlin public var type: UInt = 0u // Java private int type = 0; public int getType-pVg5ArA () { ... } public void setType-WZ4Q5Ns (int p0) { ... } Update our Kotlin logic to handle this case.
- Loading branch information
Showing
5 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+688 Bytes
(140%)
tests/Xamarin.Android.Tools.Bytecode-Tests/kotlin/NameShadowing.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters