In a test, I have: ``` cache.getIfPresentAsync(...
# coroutines
d
In a test, I have:
Copy code
cache.getIfPresentAsync("x").let { deferred ->
				assertNotNull(deferred)
				assertTrue(deferred.isCompleted)
				assertEquals(42, deferred.await())
			}
IntelliJ is giving me an inspection "Deferred result is never used" on the word assertNotNull. Is there actually anything wrong with my code? It looks like the inspection goes away if I delete the assertNotNull line and change the assertTrue to
deferred!!.isCompleted
, but I'm wondering if I'm missing something
j
Just a false-positive because
assertNotNull
returns the non-null value. You can file a bug about it if you want.
d
Does that get filed in the kotlinx.coroutines github, the kotlin Jira, or some intellij jira?
j
i suspect the inspection comes from the kotlin plugin so kotl.in/issue would be a good place to start it