Created
December 22, 2024 22:49
-
-
Save xuwei-k/ffc8923bf2f82f638b9486e601650125 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.wartremover.WartTraverser | |
import org.wartremover.WartUniverse | |
object StringTailInit extends WartTraverser { | |
def apply(u: WartUniverse): u.Traverser = | |
new u.Traverser(this) { | |
import q.reflect.* | |
override def traverseTree(tree: Tree)(owner: Symbol): Unit = { | |
tree match { | |
case Select(Apply(Ident("augmentString"), _ :: Nil), "init" | "tail") => | |
warning(tree.pos, s"空文字だと例外投げるようになるぞ! https://github.com/scala/scala/pull/10851") | |
case _ => | |
} | |
super.traverseTree(tree)(owner) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment