https://kotlinlang.org logo
#announcements
Title
# announcements
j

Jorge Castillo

11/28/2017, 4:54 PM
also is it completely mandatory to have
expected
on a common module and
actual
in a platform one?
😌 1
y

yole

11/28/2017, 4:58 PM
why would you want to do something different?
j

Jorge Castillo

11/28/2017, 5:00 PM
just some dark thoughts about whether it could be used to provide injection (implicits)
I assume it’s not the goal, but if you could be allowed to expect contracts and provide actual implementations on the same module, you could build some DI with that and not just constraint the approach to multiplatform projects
y

yole

11/28/2017, 5:03 PM
expect/actual matching is done by FQ name, and having two classes with the same FQ name in the same module would be quite problematic
p

pablisco

11/28/2017, 5:08 PM
FQ?
y

yole

11/28/2017, 5:09 PM
fully qualified
p

pablisco

11/28/2017, 5:12 PM
ah! But I'm sure no one is talking about having multiple FQ names, in the same way that Service injection works on JVM, but much better 🙂
j

Jorge Castillo

11/28/2017, 5:13 PM
The point is that expected and actual definitions match in terms of FQ name, so he means given the actual implementation of the feature and how it performs the matching it wouldn’t be possible to have both under the same module
So types do not have anything to do on the matching ?
i

ilya.gorbunov

11/28/2017, 5:21 PM
Types in method signatures should also match otherwise it would be an error.
3 Views