Hi, is there any idea why this doesn't compile? ``...
# announcements
v
Hi, is there any idea why this doesn't compile?
Copy code
typealias AndroidUri = android.net.Uri
val builder = AndroidUri.Builder()
==>
Unresolved reference: Builder
This one works as expected:
Copy code
typealias AndroidUriBuilder = android.net.Uri.Builder
val builder = AndroidUriBuilder()
a
typealiases can only point to actual types, not at packages
v
@araqnid Sorry, I don't understand your point here.
<http://android.net|android.net>.Uri
is an actual type and not a package. The first example can be rewritten to :
Copy code
import android.net.Uri

typealias AndroidUri = Uri
val builder1 = Uri.Builder()  // this works
val builder2 = AndroidUri.Builder()  // compilation error