Is there a YouTrack issue where the behavior of K2...
# k2-adopters
e
Is there a YouTrack issue where the behavior of K2 mandating to explicitly override methods in expect declarations is documented? Example:
Copy code
expect class MyList<E> : List<E>
Will work fine in K1, but not in K2. You'll be forced to override the interface methods.
a
Its very interesting how we have the same problems me n you. Perhaps its time we unite out efforts??? I have been noticing your collections problems, and your ZDeffered problems 😂 And most times you post, its a problem I have encountered before
😆 1
r
Yes, here is the YT issue: KT-59739
e
Thanks @Roman Efremov, I've had a read, although to me the "why" is still not clear. If you had to explain the choice in short, how would you do it? Was it done for the sake of simplifying the compiler implementation?
r
In short, this is because of different implementation. In K2 common code is compiled only once, while in K1 it is compiled for each platform. Because of this, when K2 compiles common code, it can't look at all actual implementations, but at the same time compiler must check that all abstract members been implemented. Thus, it is required to explicitly specify overrides in expect classes.
thank you color 1
e
So basically the one-time compilation is what gives us the build time speed up, but on the other hand it introduces a series of limitations.
a
I don't think its a limitation, its just something that was overlooked. I am pretty sure, it can be tackled when its investigated more
So, we will end up getting the one-time compilation without those kind of limitations