gammax
03/26/2021, 10:58 AMKotlinType.getJetTypeFqName
function (here). We use this function quite a lot inside detekt when resolving types.
This function is inside the JS package of the compiler: org.jetbrains.kotlin.js.descriptorUtils
but it’s implementation is platform agnostic. Why is this the case? Could this be moved inside org.jetbrains.kotlin.descriptors
?bashor
03/26/2021, 8:53 PMgammax
03/26/2021, 9:00 PMcompiler-embeddable
to check Kotlin code. We do already use such method as of today is a couple of rules:
https://github.com/detekt/detekt/search?q=getJetTypeFqName
It just feels odd that this method is inside the .js
package.bashor
03/26/2021, 9:04 PMjs
package because was written specifically for JS BE needs, but a long time ago we’ve stopped using it in most cases. Not it feels outdated so I’d not recommend using it.bashor
03/26/2021, 9:04 PMbashor
03/26/2021, 9:07 PMtype.constructor.declarationDescriptor?.fqNameSafe.asString()
bashor
03/26/2021, 9:46 PMgammax
03/28/2021, 10:00 PMAs can I see you need fqname of type, right?Yes basically yes 👍
if so, you can write something likeGreat thanks for the suggestions 🙏 Sorry for the late replay but I’m taking some days off 🌴 I’ll give it a try to see if it fully accomodates our use case and will come back to this thread.type.constructor.declarationDescriptor?.fqNameSafe.asString()
we’ve stopped using it in most cases. Not it feels outdated so I’d not recommend using it.Just out of curiosity, then why this function is not
@deprecated
? Given that it’s an extension function on KotlinType
it appears in autocompletion and contributors end up using it. A deprecation warning will help discourage it.bashor
03/29/2021, 11:30 AMJust out of curiosity, then why this function is notGood point, we definitely should deprecate it. We just didn’t work much on this part of the project for a long time, so there wasn’t time or reason to cleaning things. Also (IMO), being used as a library is not the (main) goal of the project, so we don’t spend as much time as for libraries on designing and supporting “public” API.? it appears in autocompletion and contributors end up using it. A deprecation warning will help discourage it.@deprecated