Open vinivendra opened 4 years ago
Does this issue include the fact that a static extension member is not added to the Companion
object?
I mean something like this:
extension MyClass {
static var myInstance: MyClass {
return MyClass()
}
}
which is translated to
internal val MyClass.myInstance: MyClass
get() {
return MyClass()
}
where I'd expect
internal val MyClass.Companion.myInstance: MyClass
get() {
return MyClass()
}
No, that's a whole other bug 😅 would you mind filing a new report?
It would probably be an easy fix; just translate variables the same way we translate functions.
Currently (as of Swift 5.1.3) extensions don't include their access modifiers when their AST is dumped. This is an issue with the Swift compiler that stops Gryphon being able to translate access modifiers in extensions.
Fixing this issue would allow for extensions to be treated as basically any other declaration in the access modifier algorithm.