@@ -109,7 +109,7 @@ it1 = None # type: Iterable[int]
109
109
it2 = None # type: Iterable[str]
110
110
def f(*x: int) -> None: pass
111
111
f(*it1)
112
- f(*it2) # E: Argument 1 to "f" has incompatible type Iterable[str]; expected "int"
112
+ f(*it2) # E: Argument 1 to "f" has incompatible type * Iterable[str]; expected "int"
113
113
[builtins fixtures/for.py]
114
114
115
115
@@ -190,7 +190,7 @@ class A: pass
190
190
class B: pass
191
191
[builtins fixtures/list.py]
192
192
[out]
193
- main:7: error: Argument 1 to "f" has incompatible type List[A]; expected "B"
193
+ main:7: error: Argument 1 to "f" has incompatible type * List[A]; expected "B"
194
194
195
195
[case testCallingWithTupleVarArgs]
196
196
@@ -199,9 +199,9 @@ b = None # type: B
199
199
c = None # type: C
200
200
cc = None # type: CC
201
201
202
- f(*(a, b, b)) # E: Argument 1 to "f" has incompatible type "Tuple[A, B, B]"; expected "C"
203
- f(*(b, b, c)) # E: Argument 1 to "f" has incompatible type "Tuple[B, B, C]"; expected "A"
204
- f(a, *(b, b)) # E: Argument 2 to "f" has incompatible type "Tuple[B, B]"; expected "C"
202
+ f(*(a, b, b)) # E: Argument 1 to "f" has incompatible type * "Tuple[A, B, B]"; expected "C"
203
+ f(*(b, b, c)) # E: Argument 1 to "f" has incompatible type * "Tuple[B, B, C]"; expected "A"
204
+ f(a, *(b, b)) # E: Argument 2 to "f" has incompatible type * "Tuple[B, B]"; expected "C"
205
205
f(b, *(b, c)) # E: Argument 1 to "f" has incompatible type "B"; expected "A"
206
206
f(*(a, b)) # E: Too few arguments for "f"
207
207
f(*(a, b, c, c)) # E: Too many arguments for "f"
@@ -259,26 +259,26 @@ class A: pass
259
259
class B: pass
260
260
[builtins fixtures/list.py]
261
261
[out]
262
- main:3: error: Argument 1 to "f" has incompatible type List[A]; expected "B"
263
- main:4: error: Argument 2 to "f" has incompatible type List[A]; expected "B"
262
+ main:3: error: Argument 1 to "f" has incompatible type * List[A]; expected "B"
263
+ main:4: error: Argument 2 to "f" has incompatible type * List[A]; expected "B"
264
264
main:5: error: Argument 1 to "f" has incompatible type "B"; expected "A"
265
265
main:6: error: Argument 2 to "f" has incompatible type "A"; expected "B"
266
- main:7: error: Argument 3 to "f" has incompatible type List[A]; expected "B"
266
+ main:7: error: Argument 3 to "f" has incompatible type * List[A]; expected "B"
267
267
main:8: error: Argument 1 to "f" has incompatible type "B"; expected "A"
268
- main:9: error: Argument 1 to "g" has incompatible type List[B]; expected "A"
268
+ main:9: error: Argument 1 to "g" has incompatible type * List[B]; expected "A"
269
269
270
270
[case testCallingVarArgsFunctionWithTupleVarArgs]
271
271
272
272
a, b, c, cc = None, None, None, None # type: (A, B, C, CC)
273
273
274
- f(*(b, b, b)) # E: Argument 1 to "f" has incompatible type "Tuple[B, B, B]"; expected "A"
275
- f(*(a, a, b)) # E: Argument 1 to "f" has incompatible type "Tuple[A, A, B]"; expected "B"
276
- f(*(a, b, a)) # E: Argument 1 to "f" has incompatible type "Tuple[A, B, A]"; expected "B"
277
- f(a, *(a, b)) # E: Argument 2 to "f" has incompatible type "Tuple[A, B]"; expected "B"
274
+ f(*(b, b, b)) # E: Argument 1 to "f" has incompatible type * "Tuple[B, B, B]"; expected "A"
275
+ f(*(a, a, b)) # E: Argument 1 to "f" has incompatible type * "Tuple[A, A, B]"; expected "B"
276
+ f(*(a, b, a)) # E: Argument 1 to "f" has incompatible type * "Tuple[A, B, A]"; expected "B"
277
+ f(a, *(a, b)) # E: Argument 2 to "f" has incompatible type * "Tuple[A, B]"; expected "B"
278
278
f(b, *(b, b)) # E: Argument 1 to "f" has incompatible type "B"; expected "A"
279
279
f(b, b, *(b,)) # E: Argument 1 to "f" has incompatible type "B"; expected "A"
280
280
f(a, a, *(b,)) # E: Argument 2 to "f" has incompatible type "A"; expected "B"
281
- f(a, b, *(a,)) # E: Argument 3 to "f" has incompatible type "Tuple[A]"; expected "B"
281
+ f(a, b, *(a,)) # E: Argument 3 to "f" has incompatible type * "Tuple[A]"; expected "B"
282
282
f(*()) # E: Too few arguments for "f"
283
283
f(*(a, b, b))
284
284
f(a, *(b, b))
@@ -322,7 +322,7 @@ from typing import List
322
322
aa = None # type: List[A]
323
323
ab = None # type: List[B]
324
324
325
- g(*aa) # E: Argument 1 to "g" has incompatible type List[A]; expected "B"
325
+ g(*aa) # E: Argument 1 to "g" has incompatible type * List[A]; expected "B"
326
326
f(*aa)
327
327
f(*ab)
328
328
g(*ab)
@@ -359,25 +359,25 @@ class B: pass
359
359
[builtins fixtures/list.py]
360
360
[out]
361
361
main:3: error: Too few arguments for "f"
362
- main:4: error: Argument 2 to "f" has incompatible type List[A]; expected "B"
363
- main:5: error: Argument 3 to "f" has incompatible type List[A]; expected "B"
364
- main:6: error: Argument 1 to "f" has incompatible type "Tuple[A, A, B]"; expected "B"
362
+ main:4: error: Argument 2 to "f" has incompatible type * List[A]; expected "B"
363
+ main:5: error: Argument 3 to "f" has incompatible type * List[A]; expected "B"
364
+ main:6: error: Argument 1 to "f" has incompatible type * "Tuple[A, A, B]"; expected "B"
365
365
366
366
[case testVarArgsAfterKeywordArgInCall1]
367
367
def f(x: int, y: str) -> None: pass
368
368
f(x=1, *[2])
369
369
[builtins fixtures/list.py]
370
370
[out]
371
371
main:2: error: "f" gets multiple values for keyword argument "x"
372
- main:2: error: Argument 2 to "f" has incompatible type List[int]; expected "str"
372
+ main:2: error: Argument 2 to "f" has incompatible type * List[int]; expected "str"
373
373
374
374
[case testVarArgsAfterKeywordArgInCall2]
375
375
def f(x: int, y: str) -> None: pass
376
376
f(y='x', *[1])
377
377
[builtins fixtures/list.py]
378
378
[out]
379
379
main:2: error: "f" gets multiple values for keyword argument "y"
380
- main:2: error: Argument 2 to "f" has incompatible type List[int]; expected "str"
380
+ main:2: error: Argument 2 to "f" has incompatible type * List[int]; expected "str"
381
381
382
382
[case testVarArgsAfterKeywordArgInCall3]
383
383
def f(x: int, y: str) -> None: pass
@@ -469,11 +469,11 @@ class A: pass
469
469
class B: pass
470
470
[builtins fixtures/list.py]
471
471
[out]
472
- main:6: error: Argument 1 to "f" has incompatible type List[A]; expected "B"
473
- main:7: error: Argument 1 to "f" has incompatible type List[A]; expected "B"
472
+ main:6: error: Argument 1 to "f" has incompatible type * List[A]; expected "B"
473
+ main:7: error: Argument 1 to "f" has incompatible type * List[A]; expected "B"
474
474
main:8: error: Argument 1 to "f" has incompatible type "B"; expected "A"
475
- main:9: error: Argument 2 to "f" has incompatible type List[A]; expected "B"
476
- main:10: error: Argument 3 to "f" has incompatible type List[A]; expected "B"
475
+ main:9: error: Argument 2 to "f" has incompatible type * List[A]; expected "B"
476
+ main:10: error: Argument 3 to "f" has incompatible type * List[A]; expected "B"
477
477
main:11: error: List or tuple expected as variable arguments
478
478
main:12: error: List or tuple expected as variable arguments
479
479
@@ -483,9 +483,9 @@ S = TypeVar('S')
483
483
T = TypeVar('T')
484
484
a, b = None, None # type: (A, B)
485
485
486
- a, a = f(*(a, b)) # E: Argument 1 to "f" has incompatible type "Tuple[A, B]"; expected "A"
486
+ a, a = f(*(a, b)) # E: Argument 1 to "f" has incompatible type * "Tuple[A, B]"; expected "A"
487
487
b, b = f(a, *(b,)) # E: Argument 1 to "f" has incompatible type "A"; expected "B"
488
- a, a = f(*(a, b)) # E: Argument 1 to "f" has incompatible type "Tuple[A, B]"; expected "A"
488
+ a, a = f(*(a, b)) # E: Argument 1 to "f" has incompatible type * "Tuple[A, B]"; expected "A"
489
489
b, b = f(a, *(b,)) # E: Argument 1 to "f" has incompatible type "A"; expected "B"
490
490
a, b = f(*(a, b, b)) # E: Too many arguments for "f"
491
491
@@ -525,7 +525,7 @@ class B: pass
525
525
main:9: error: Incompatible types in assignment (expression has type List[A], variable has type "A")
526
526
main:9: error: Incompatible types in assignment (expression has type List[None], variable has type List[A])
527
527
main:10: error: Incompatible types in assignment (expression has type List[None], variable has type "A")
528
- main:11: error: Argument 1 to "f" of "G" has incompatible type List[A]; expected "B"
528
+ main:11: error: Argument 1 to "f" of "G" has incompatible type * List[A]; expected "B"
529
529
main:11: error: Incompatible types in assignment (expression has type List[None], variable has type List[A])
530
530
531
531
0 commit comments