void () { Object object = "1234"; switch (object) { case String s when <error descr="Variable used in guarded pattern should be final or effectively final">s</error>.length()==2 -> { s = null; } default -> { } } }