Skip to content

Type inference for local classes always results in Any? #194

@Jolanrensen

Description

@Jolanrensen
@DataSchema
data class GpsA(
    val latitude: Double,
    val longitude: Double,
)

fun main() {

    @DataSchema
    data class GpsB(
        val latitude: Double,
        val longitude: Double,
    )
    columnOf(GpsA(1.0, 2.0)).type shouldBe typeOf<GpsA>() // correct
    columnOf(GpsB(1.0, 2.0)).type shouldBe typeOf<GpsB>() // wrong, is Any?
}

Maybe this intended behavior if GpsB for instance cannot be accessed by the code generation plugin, but this is not clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions