Since I wanted to specialize some return types in ...
# javascript
e
Since I wanted to specialize some return types in externals subclasses/subinterfaces, I ended up using:
Copy code
@Suppress("VAR_TYPE_MISMATCH_ON_OVERRIDE")
https://github.com/lppedd/kotlin-externals/commit/275f011ea65ebc6e6c57b855f71c4697d5ec8d70 It compiles, but with K2 I get:
Copy code
This code uses error suppression for 'VAR_TYPE_MISMATCH_ON_OVERRIDE'. While it might compile and work, the compiler behavior is UNSPECIFIED and WON'T BE PRESERVED
So I was wondering if it make sense to keep it. Haven't found another way apart from using annotations.
a
I mean, as we discuss such changes just not sound in terms of type system. You could keep it, but we don't guarantee stability for code that uses
@Suppress
.
e
By stability you mean that the suppression could just stop working?
a
Yes, or the code that worked before with the new release could stop working.
gratitude thank you 1
e
Ok! I'll keep it for now, since the places where it's done are very limited.
🫡 1
t
If it will stop working - we have magic pills :)
🔝 1