# This sample tests the type checker's reportUnnecessaryCast feature.

from typing import cast, Union


def foo(a: int):
    # This should generate an error if
    # reportUnnecessaryCast is enabled.
    b = cast(int, a)


c: Union[int, str] = "hello"
d = cast(int, c)

[(13, 'typing.cast', 'cast', False, 'from typing import cast, Union\n'), (9, 'typing.cast', 'cast', False, 'from typing import cast, Union\n')]