Skip to content

Commit

Permalink
Two more options in mangling scheme for static extensions on JVM from @…
Browse files Browse the repository at this point in the history
  • Loading branch information
elizarov committed Mar 25, 2023
1 parent 87d470e commit 796c8a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proposals/statics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,8 @@ import when the short name is typed.

[Static extensions on JVM](#static-extensions-on-jvm) section gives one scheme for mangling the name
of static extensions so that it is readable nicely on JVM. It is not clear-cut decision on which scheme to choose,
so here is a larger list of options. As example, we'll show JVM names for the following static extensions:
so here is a larger list of options. They vary in the separator that is used (or an absence thereof) and
in the order of components. As example, we'll show JVM names for the following static extensions:

```kotlin
val Color.static.background: Color // Color.background
Expand All @@ -1816,6 +1817,8 @@ fun <T> Box.static.of(value: T): Box<T> // Box.of
| 1 | name$Class | `getBackground$Color` | `parse$Color` | `of$Box` |
| 2 | lower(Class)upper(name) | `getColorBackground` | `colorParse` | `boxOf` |
| 3 | nameClass | `getBackgroundColor` | `parseColor` | `ofBox` |
| 4 | Class_name | `getColor_background` | `Color_parse` | `Box_of` |
| 5 | Class::name | `getColor::background` | `Color::parse` | `Box::of` |

### ABI for non-JVM platforms

Expand Down

0 comments on commit 796c8a8

Please sign in to comment.