Vampire
10/05/2020, 4:28 PMUnnecessary safe call on a non-null receiver of type Int?Why is
Int?
non-null?
Why is it wrong to use ?.
on it?Nir
10/05/2020, 4:29 PMVampire
10/05/2020, 4:30 PMval buildId = buildId.get()?.let { "=$it" } ?: ""
Where the get()
returns an Int?
Vampire
10/05/2020, 4:31 PM?
it says the opposite,
Unsafe use of a nullable receiver of type Int?
Vampire
10/05/2020, 4:32 PMNir
10/05/2020, 4:34 PMNir
10/05/2020, 4:34 PMJakub Pi
10/05/2020, 4:34 PMNir
10/05/2020, 4:34 PMVampire
10/05/2020, 4:56 PMVampire
10/05/2020, 4:56 PMVampire
10/05/2020, 4:57 PMNir
10/05/2020, 5:04 PMVampire
10/05/2020, 5:09 PMget()
will never return null
but throw an exception instead, so even though the type is Int?
there will never be null
returnedVampire
10/05/2020, 5:10 PMNir
10/05/2020, 5:12 PM