Is there a known issue with inline classes that ha...
# announcements
Is there a known issue with inline classes that have a type
where an inlined property that uses a
scope on an instance of the same type as
gets unwrapped to use the class instance instead of the actual one? Something like (using custom extensions on
Copy code
value class MyJson(val json: JsonObject) {
  inline val type
    get() = with(json.jsonObject("type") {
        string("actual_type") // this crashes at runtime because it is looking for this field in the json property instead of the one from the with scope
Switching to `json.jsonObject("type").let { type ->`works
I believe it's not a known issue, can you please file it to with a self-contained code sample to reproduce?
­čĹŹ 1
I haven't been able to repro. I'm leaning towards blaming this on Android Studio's "apply changes" feature because nothing else makes any sense.
This issue fixed itself eventually, which makes me think it's related to which I just filed for a separate issue (same class though)