You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest adding a MapPartial Wart similar to OptionPartial and TryPartial. I t should prevent calling the apply method on a Map instance which can throw a java.util.NoSuchElementException.
I tried doing it myself, but I really struggle with the macro syntax. I think that it should be straight forward for someone more experienced in macros.
test("can't use Map#apply") {
valresult=WartTestTraverser(MapPartial) {
println(Map(1->"")(1))
}
assertError(result)("Map#apply is disabled - use Map#getOrElse instead")
}
The text was updated successfully, but these errors were encountered:
I suggest adding a MapPartial Wart similar to OptionPartial and TryPartial. I t should prevent calling the apply method on a Map instance which can throw a
java.util.NoSuchElementException
.I tried doing it myself, but I really struggle with the macro syntax. I think that it should be straight forward for someone more experienced in macros.
The text was updated successfully, but these errors were encountered: