Discussion:
warning when invoking method on java object
Sonny To
2017-09-17 14:34:11 UTC
Permalink
(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.
Sudarshan S Chawathe
2017-09-17 14:44:59 UTC
Permalink
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
Date: Sun, 17 Sep 2017 07:34:11 -0700
Subject: warning when invoking method on java object
(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.
Loading...