Any good examples of `FirTypeAttributeExtension`? ...
# compiler
y
Any good examples of
FirTypeAttributeExtension
? I'm trying to implement Scala's Capture Checking as a FIR plugin.
FirTypeAttributeExtension
doesn't seem enough on its own though, and likely I have to add some checkers as well, no? Does
FirTypeAttributeExtension
affect call resolution as well? I don't actually want that, so I'm hoping it doesn't.
In fact it seems like what I'm asking for is some explanation of
ConeAttribute
and how to use it! Seems like it has
isSubtypeOf
, which is likely what I want!
b
The sandbox plugin has an example of
@Positive
and
@Negative
annotations which are translated to an attribute which can then restrict function calls. There's a test which shows some examples as well.
thank you color 1
y
Given how underused as an extension it is, is it likely to go away? I know there's 0 guarantees about FIR extensions in general. I guess more so, are there any plans to get rid of it? Is it a maintenance burden? Or is it simple enough that like there's no reason to get rid of it short-term? I know that's a difficult question to answer, so feel free not to! I'm just trying to figure out if I should build something purely using Checkers instead (since Checkers seem unlikely to go away in one form or another).
b
I think it's unlikely to go anywhere. ConeAttributes have significant use internally and this extension is a very low maintenance burden.
thank you color 1