Skip to content

Consider upper bounds when generating local types in compiler plugin #905

Open
@koperagen

Description

@koperagen

Given API with type parameter bound to something:

interface Geo {
  val geometry: Geometry
}
internal class GeoDataFrame<T : Geo>(val df: DataFrame<T>) {
    fun update(f: DataFrame<T>.() -> DataFrame<T>): DataFrame<T> = TODO()
}

Two things can go wrong in combination with compiler plugin

geo.update { remove { geometry } }
  1. type of DataFrame after remove is not subtype of Geo. So org.jetbrains.kotlinx.dataframe.plugin.extensions.FunctionCallTransformer#intercept must somehow figure out that this supertype is needed. Note that incercept happens before call completion
  2. even if type is preserved, there will be no longer such column. An additional checker should be there to report that column is missing
    related to Geo extensions for DataFrame #875

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compiler pluginAnything related to the DataFrame Compiler Plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions