Commit 3d47629
Fix TypeTable support for Kotlin K2 by restoring annotation escape sequences (#6779)
The K2 upgrade bypass of TypeTable was unnecessary. The real issue was a bug in
the annotation deserializer that corrupted Kotlin metadata: missing escape
sequence handlers for \b (backspace) and \f (form feed) caused these control
characters to be converted to literal 'b' and 'f' in @kotlin.Metadata
annotations, making them unreadable by K2's FIR compiler.
Fixed by adding the missing cases in TypeTableAnnotationSupport.parseStringValue(),
restored classpathFromResources() in KotlinParser to use TypeTable, and added a
test verifying TypeTable stubs work with K2.
Co-authored-by: Tim te Beek <tim@mac.home>1 parent f2a013b commit 3d47629
3 files changed
Lines changed: 54 additions & 9 deletions
File tree
- rewrite-java/src/main/java/org/openrewrite/java/internal/parser
- rewrite-kotlin/src
- main/java/org/openrewrite/kotlin
- test/java/org/openrewrite/kotlin
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
539 | 545 | | |
540 | 546 | | |
541 | 547 | | |
| |||
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 303 | + | |
| 304 | + | |
312 | 305 | | |
313 | 306 | | |
314 | 307 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments