Thread
#multiplatform
    s

    Skolson5903

    10 months ago
    Does anyone know the Intellij Idea youtrack issue URL or number for the problem with the IDE showing a false syntax error on any usage of an actual fun that doesn't specify a parameter with a default value in the expect definition? I've got a number of these and would like to start watching the issue that must be out there, but my searches are not finding it. To clarify, here's an example of the defect with a constructor, same thing happens on expect/actual fun:
    expect class Anything(
        arg1: String,
        arg2: String = ""
    ) { ... }
    
    actual class Anything(
        arg1: String,
        arg2: String
    ) { ... }
    
    val x = Anything("x")
    Every usage like this compiles fine in gradle and runs fine, but the IDE wrongly shows the assignment statement as a syntax error. The IDE inspection is going by the actual syntax which is not allowed to duplicate the default value defined in the expect. I have enough of these that the IDE defect is making me never want to use arguments with default values in an expect class again 😃
    c

    CLOVIS

    9 months ago
    This might get you on track: https://youtrack.jetbrains.com/issue/KT-24461 I know the problem also happens with Compose, but I don't remember anything about normal functions. If you really don't find anything, you should probably report it yourself.