void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> doTestByText(""" from typing_extensions import Final for i in undefined: if undefined: <warning descr="'Final' could not be used inside a loop">x</warning>: Final[int] = 1 while undefined: <warning descr="'Final' could not be used inside a loop">y</warning>: Final[str] = '1' \s def foo(): for i in undefined: if undefined: <warning descr="'Final' could not be used inside a loop">x</warning>: Final[int] = 1 while undefined: <warning descr="'Final' could not be used inside a loop">y</warning>: Final[str] = '1'""") ); }