1
Fork 0

Suggest replacing typeof(...) with an actual type

This commit suggests replacing typeof(...) with an actual type of "...",
for example in case of `typeof(1)` we suggest replacing it with `i32`.

If the expression
- Is not const (`{ let a = 1; let _: typeof(a); }`)
- Can't be found (`let _: typeof(this_variable_does_not_exist)`)
- Or has non-suggestable type (closure, generator, error, etc)
we don't suggest anything.
This commit is contained in:
Maybe Waffle 2022-04-07 22:46:53 +04:00
parent fa72316031
commit d5440926e2
3 changed files with 17 additions and 3 deletions

View file

@ -62,6 +62,7 @@ typeck-functional-record-update-on-non-struct =
typeck-typeof-reserved-keyword-used =
`typeof` is a reserved keyword but unimplemented
.suggestion = consider replacing `typeof(...)` with an actual type
.label = reserved keyword
typeck-return-stmt-outside-of-fn-body =