yole
10/20/2017, 9:23 AMjanvladimirmostert
10/20/2017, 9:24 AMit
is null
here, you'd be doing null == true
, something to get used to I guesskirillrakhman
10/20/2017, 10:31 AMBoolean?
can have three states, true
, false
and null
. == true
expresses clearly, that you're only interested in one of the stateskirillrakhman
10/20/2017, 10:32 AM== true
is never useful in Javapoohbar
10/20/2017, 4:12 PMyole
10/20/2017, 4:13 PMyole
10/20/2017, 4:14 PMpoohbar
10/20/2017, 5:35 PMLeon Linhart
10/20/2017, 6:09 PMuser
10/21/2017, 12:33 AMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
user
10/21/2017, 6:56 AMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
user
10/21/2017, 10:03 AMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
@NotNull
annotation.
- IntelliJ provides an inspection that reports calling such functions from Java code. (Left image)
- The inferred annotations are ignored for Kotlin inspections.
So what I should have been asking for is: Is there an option to treat inferred annotations as explicit when inspecting type nullability in Kotlin code?user
10/22/2017, 1:22 PMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
user
10/22/2017, 2:45 PMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
null
to a platform type (T!
) or passing a platform type to code that is not null safe is perfectly fine and accepted by the compiler, since T!
may be either T
or T?
.
Since IntelliJ is capable of inferring nullability annotations for types in Java would it not be logical to (optionally) consider them to be part of the nullability contract of a said type representation when used from Kotlin? (Say an inspection similar to Java > Probable bugs > Constant Conditions & exceptions
?)
My initial question was whether such an inspection exists. I assume it does not at this point. Once again, I want to apologize for any misunderstandings that my wording might have caused.karelpeeters
10/22/2017, 2:46 PMLeon Linhart
10/22/2017, 3:29 PMuser
10/23/2017, 10:15 AMhttps://kotlinlang.slack.com/files/U4NLYMY9X/F7MKN8BJQ/pasted_image_at_2017_10_20_08_07_pm.png▾
karelpeeters
10/23/2017, 10:18 AMpoohbar
10/23/2017, 12:13 PMbaob
10/23/2017, 5:44 PM> Could not find method cd() for arguments [unspecified] on root project
Already googled … nothing I could see that was relevantkarelpeeters
10/23/2017, 5:46 PMbaob
10/23/2017, 5:47 PMkarelpeeters
10/23/2017, 5:47 PMbaob
10/23/2017, 5:48 PMbuild.gradle
starts with cd version '1.0-SNAPSHOT
so I’ve commented that outbaob
10/23/2017, 5:50 PMPasted image at 2017-10-23, 6:51 PM▾
yole
10/23/2017, 5:59 PMbaob
10/23/2017, 6:04 PMyole
10/23/2017, 6:18 PMbaob
10/23/2017, 6:38 PMEugen Martynov
10/25/2017, 9:25 AM