-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
I have mentioned this on gitter, but I think it might be a good idea to open an issue to track this. Current mypy output is a bit harsh. Compare (I know these are different kind of errors, but still)
(mypy-dev) ~/src/mypy [master] λ cat x.py
from typing import Tuple
v: Tuple[int] = list(10)
(mypy-dev) ~/src/mypy [master] λ mypy x.py
x.py:2: error: No overload variant of "list" matches argument types [builtins.int]
to
~/src/mypy [master] λ cat x.rs
fn main() {
let v: &[usize] = Vec::with_capacity("10");
}
~/src/mypy [master] λ rustc x.rs
error[E0308]: mismatched types
--> x.rs:2:42
|
2 | let v: &[usize] = Vec::with_capacity("10");
| ^^^^ expected usize, found reference
|
= note: expected type `usize`
found type `&'static str`
= help: here are some functions which might fulfill your needs:
- .len()
error[E0308]: mismatched types
--> x.rs:2:23
|
2 | let v: &[usize] = Vec::with_capacity("10");
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected &[usize], found struct `std::vec::Vec`
|
= note: expected type `&[usize]`
found type `std::vec::Vec<_>`
= help: here are some functions which might fulfill your needs:
- .as_slice()
error: aborting due to 2 previous errors
Rustc output is specified here.
I don't have any ideas other than that we could start adding at least come colors. I'm pretty sure that we should keep the old format as an option, because it is useful for various tools like neomake, it drives current test-cases-as-data and simply some people might prefer that.
shonfeder and aliaksandr-master