-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Improvement of mismatching type variable error message #3911
Changes from all commits
71b81f5
92ebb12
648214c
b3f3af4
ef16575
80c321a
f432390
f553583
9f1afb1
c09f74d
fe0ec79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -852,7 +852,8 @@ fun1(1) # E: Argument 1 to "fun1" has incompatible type "int"; expected "List[Tu | |
fun1([(1, 'x')]) # E: Cannot infer type argument 1 of "fun1" | ||
|
||
reveal_type(fun2([(1, 1)], 1)) # E: Revealed type is 'builtins.list[Tuple[builtins.int*, builtins.int*]]' | ||
fun2([('x', 'x')], 'x') # E: Value of type variable "T" of "fun2" cannot be "str" | ||
fun2([('x', 'x')], 'x') # E: Argument types for type variable "T" are incompatible in call to "fun2" \ | ||
# N: Arguments "v" and "scale" in call to "fun2" must all have the same type for "T" (one of "int", "bool") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In understand why you formulate the note this way (because of, e.g.,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels like it might be an enhancement on top of this change (which should end up displaying what we expected to see, and what was actually passed in). |
||
|
||
[builtins fixtures/list.pyi] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking into account that positional arguments are more often used than keyword arguments, it is much more convenient to see the position of the argument, not its name at call site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood; I'll look at making this switch as when I start passing the arguments through the call stack.