Is this a known bug?
# announcements
c
Is this a known bug?
k
I don't mean no be snarky but are you sure that they're the same string? Does
Ctrl+Shift+B
(go to type definition) get you the same one on both?
c
@karelpeeters both jump me to the same location, class kotlin.String in kotlin.kotlin_builtins
s
What are the definitions of the two
fileExtension
functions?
c
it seems to be happening for delegated properties
k
And is it possible to create a mininal example?
c
image.png
Copy code
val ScriptCompilationConfigurationKeys.fileExtension by PropertiesCollection.key<String>("kts")
val ScriptEvaluationConfigurationKeys.hostConfiguration by PropertiesCollection.key<ScriptingHostConfiguration>()
val ScriptCompilationConfigurationKeys.displayName by PropertiesCollection.key<String>("Kotlin script")
s
What is the type of
fileExtension
?
c
(for reference, I've checked out the 1.3.41 release of Kotlin)
image.png
that's where I'm seeing these errors
s
How is
PropertiesCollection.Key<T>
defined?
c
Copy code
class PropertyKeyDelegate<T>(private val getDefaultValue: PropertiesCollection.() -> T?) {
        constructor(defaultValue: T?) : this({ defaultValue })

        operator fun getValue(thisRef: Any?, property: KProperty<*>): Key<T> =
            Key(property.name, getDefaultValue)
    }
s
That is the delegate of a
PropertiesCollection.Key<T>
. How is
PropertiesCollection.Key<T>
itself defined?
k
Just create a pastebin somewhere with the full code that we can run.
☝️ 1
This is the definition of Key itself
and on line 78 you have the invoke function which is what's called in my original screenshot
s
There are a loooooot of overloaded
invoke
functions there! Did you try it with an older kotlin version. The one in 1.3.41 has a newer type-inference engine… maybe that is messing up. It could be that the IDE is complaining, but compilation may be successful.
c
thanks for the help, I've just created an issue on YouTrack
k
Link?