Skip to content

Class contains a property with the same name but different package #689

@hfhbd

Description

@hfhbd

Describe the bug
A class Bug is in package a and b. a.Bug contains a property of type: b.Bug.
|
-- a
--- Bug.kt
-- b
---- Bug.kt
To Reproduce

package a

import b.Bug
import kotlinx.serialization.Serializable

@Serializable
data class Bug(val id: Long = 0) {
    val d get() = Bug()
}

// ------

package b

class Bug

or github project

Expected behavior
a serializable class, valid to JSON "{"id": 0}"

Environment

  • Kotlin version: 1.3.61
  • Library version: 0.14
  • Kotlin platforms: JVM
  • Gradle version: 5.2.1
  • IDE version: IntelliJ IDEA 2019.3.2
  • Other relevant context: -

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions