warning when invoking method on java object

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

warning when invoking method on java object

Sonny To
 (context:startActivity i)

gives a warningi
/dev/stdin:23:2: warning - no known slot 'startActivity' in java.lang.Object

it works but why is it giving a warning?

I could do
((as android.app.Application context):startActivity i)

and not get a warning but its more verbose. what is more idiomatic? I
prefer the former but I am concern about getting warnings.
Reply | Threaded
Open this post in threaded view
|

Re: warning when invoking method on java object

Sudarshan S Chawathe
I have found that declaring the types of a few key variables and
procedures (using the ::footype syntax) usually gives the
type-inferencing engine enough information to infer the needed types for
the remaining variables (typically generated from the earlier ones by
applying Java methods) and avoid the warnings.

Regards,

-chaw

> From: Sonny To <[hidden email]>
> Date: Sun, 17 Sep 2017 07:34:11 -0700
> Subject: warning when invoking method on java object
> To: Kawa mailing list <[hidden email]>
>
>  (context:startActivity i)
>
> gives a warningi
> /dev/stdin:23:2: warning - no known slot 'startActivity' in java.lang.Object
>
> it works but why is it giving a warning?
>
> I could do
> ((as android.app.Application context):startActivity i)
>
> and not get a warning but its more verbose. what is more idiomatic? I
> prefer the former but I am concern about getting warnings.
>