https://kotlinlang.org logo
#compiler
Title
# compiler
t

Tóth István Zoltán

03/01/2024, 7:14 AM
When returning names with
FirDeclarationGenerationExtension.getCallableNamesForClass
how are these names mixed with the ones from the original source code and the ones generated by other plugins? For example, if the original code have the function already, should I return with the name still?
Also, what happens when two different plugins returns with the same name?
d

dmitriy.novozhilov

03/01/2024, 7:55 AM
With functions there is no problem, as there are overloads in the language
Copy code
fun foo(x: Int) {}
fun foo(x: String) {}
With classes it's more complex • if there is a class with given name in sources, it will be used, plugin won't be called • if two plugins want to generate two classes with the same name, compiler will crash with exception
thank you color 1
4 Views