Repository navigation
Fix: An int argument picks the overload its Kotlin literal would - #156
Merged
Merged
Conversation
An integral slot takes an int only inside its Kotlin type's range, and a tie between overloads goes to the one whose integral slots match each int's literal type (Int if it fits in 32 bits, else Long), as kotlinc resolves Color(0xFFFFFFFF) to Color(Long). Red before the change: anIntArgumentPicksTheOverloadItsKotlinLiteralWould failed (18 run, 1 failed).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #146
Defect fixed: an integral slot accepted any int (an Int slot took 2**31), and an int that fit two overloads' integral slots was refused as ambiguous. Now an int reaches an integral slot only inside that Kotlin type's range, and a remaining tie goes to the overload whose integral slots match each int's Kotlin literal type (Int if it fits in 32 bits, else Long), as kotlinc resolves Color(0xFFFFFFFF) to Color(Long).
Test added: PythonxAdapterTest.anIntArgumentPicksTheOverloadItsKotlinLiteralWould, with Color__Int/Color__Long in ComposeShapedFragment. Red before the fix (18 run, 1 failed).
Spec: SPEC U-8.
Verified locally, each module separately: plugin test 274/0, desktopTest 608/0, artifact 35/0, app 79/0, compose 118 with 1 failure in the first run (aCounterDeclaredAsMutableStateOfZeroAndIncrementedFromPythonRecomposes, the known intermittent one, also seen on develop), then 3 of 3 reruns green; androidNative compile OK.