Commit 4bef3d1
authored
Fix Kotlin method declaringType for primitive receivers (#7413)
When building the declaring type in `methodDeclarationType`, non-nullable
Kotlin primitives like `kotlin.Char` were collapsed to JVM primitives via
`type()`, resulting in `JavaType.Unknown` as the declaring type. Use
`asDeclaringType` (which calls `classType` directly) when the dispatch
receiver is a `ConeClassLikeType` to bypass the primitive remap, mirroring
what `methodInvocationType` already does.
Fixes #74081 parent b11dce1 commit 4bef3d1
2 files changed
Lines changed: 39 additions & 2 deletions
File tree
- rewrite-kotlin/src
- main/kotlin/org/openrewrite/kotlin
- test/java/org/openrewrite/kotlin
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
684 | 688 | | |
| 689 | + | |
| 690 | + | |
685 | 691 | | |
686 | 692 | | |
687 | | - | |
| 693 | + | |
| 694 | + | |
688 | 695 | | |
689 | 696 | | |
690 | 697 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1816 | 1816 | | |
1817 | 1817 | | |
1818 | 1818 | | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1819 | 1849 | | |
1820 | 1850 | | |
1821 | 1851 | | |
| |||
0 commit comments