Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation where the 'in' parameter lacks the required `` #92

Open
Llonvne opened this issue Dec 9, 2023 · 1 comment · May be fixed by #93
Open

Code generation where the 'in' parameter lacks the required `` #92

Llonvne opened this issue Dec 9, 2023 · 1 comment · May be fixed by #93

Comments

@Llonvne
Copy link

Llonvne commented Dec 9, 2023

Hello,I have a data class like that with a in parameter in primary constructor like this

@Serializable
data class PipeMap(
    val `in`: PipeIndex,  // input end of the pipe
    val out: PipeIndex, // output end of the pipe
    // enable pipe proxy from in to out,
    // content from in will be discarded if out closes
    val proxy: Boolean? = null,
    val name: String? = null,   // copy out proxy content if proxy enabled
    // limit the copy out content size,
    // proxy will still functioning after max
    val max: Int? = null
)

and Kopykat generate code like this

public inline fun PipeMap.copyMap(
  `in`: PipeMap.(PipeIndex) -> PipeIndex = { it },
  `out`: PipeMap.(PipeIndex) -> PipeIndex = { it },
  proxy: PipeMap.(Boolean?) -> Boolean? = { it },
  name: PipeMap.(String?) -> String? = { it },
  max: PipeMap.(Int?) -> Int? = { it },
): PipeMap = copy(in = in(this, this.in), out = out(this, this.out), proxy = proxy(this,
    this.proxy), name = name(this, this.name), max = max(this, this.max))

yes, in the copy function the 'in' parameter lacks the required ``

@Llonvne
Copy link
Author

Llonvne commented Dec 9, 2023

it seem to occur on any reserved key words in kotlin

@serras serras linked a pull request Dec 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant