# 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, 4, 13, 16), 'typing.cast', 'cast', ({(13, 9, 13, 12): 'int', (13, 14, 13, 15): 'c'}, {}), '(int, c)', False, 'from typing import cast, Union\n'), ((9, 8, 9, 20), 'typing.cast', 'cast', ({(9, 13, 9, 16): 'int', (9, 18, 9, 19): 'a'}, {}), '(int, a)', False, 'from typing import cast, Union\n')]