void () { doTest("Dict[str, Union[int, str]]", """ def f(): expr = {'a': 3} expr['b'] = "s\"""" ); doTest("Dict[str, Union[int, str]]", """ def f(): expr = {'a': 3} expr['b'] = "s\"""" ); doTest("Dict[str, Union[int, List[int]]]", """ def f(): expr = {} expr['a'] = 0 expr['c'] = [1, 2]""" ); doTest("Dict[str, Union[int, Any]]", """ def f(): expr = {'b': D()} expr['a'] = 2 """ ); doTest("Dict[str, Union[int, str]]", """ def f(): expr = {'a': 3} expr['b'], t = "s", 12""" ); doTest("Dict[str, Union[int, Any]]", """ def f(): expr = {'a': 3} expr['a'] = var """ ); doTest("Dict[str, int]", """ def f(): expr = {'a': 3, 'b': 4} """ ); doTest("Dict[str, Union[int, str]]", """ def f(): expr = {'a': 3} expr.update({'a': 'str'}) """ ); doTest("Dict[str, Union[int, Any]]", """ def f(): expr = {'a': 3} expr.update({'b': var}) """ ); doTest("Dict[str, int]", """ def f(): expr = {} expr.update(a=1, b=2)""" ); doTest("Dict[Union[int, str], Union[int, str]]", """ def f(): expr = {1: '3'} expr.update(a=1, b=2)""" ); doTest("Dict[str, Union[int, str]]", """ def f(): expr = {} expr['a'] = 23 expr.update(a='m', b='n')""" ); doTest("Dict[str, Union[int, str]]", """ def f(): b, expr = 23, {'a': 3} expr['b'] = 'l'""" ); doTest("Dict[str, int]", """ def f(): expr = {'a': 1} def inner(): expr['b'] = 'a' """ ); }