just found this in a pull request: ``` val someth...
# language-proposals
just found this in a pull request:
Copy code
val something = when(business) {
  someCase -> {
    POKOType.forName(name) ?: Log.warning("angry"); POKOType()
If i had some kind of
ref-transparent enforcement I could at least get this code tagged as suspicious, if not generate a compiler failure out right. whats the most aggressive thing I can do in my build system to catch this?
What rule could catch it? The result of
is used in elvis operator.
It's equivalent to the following code:
Copy code
if (POKOType.forName(name) == null) {
return POKOType()
Its a bit odd that the elvis operator is only used to perform a side effect, and the result of the expression is discarded.
Tell me this is definitely a logical bug…