check.errorf(e, NotAType, "%s is not a type", obj.Name())Alan DonovanI would simply do this for now:
check.errorf(e, NotAType, "%s is not a type", obj)
This is good enough for this error.
As a separate and independent CL, I think we can improve error messages that print objects.
I tried that initially, but the error messages were rather unsatisfactory, for example:
```
a.go:5:8: var error error is not a type
```
or in more pathological cases,
```
a.go:5:8: var error func(int, string, bool) (error, []chan int) is not a type
```
Compare with the latest draft of this CL:
```
a.go:5:8: error is a local variable, not a type
a.go:4:6: declaration of error as local variable here shadows a type
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
check.errorf(e, NotAType, "%s is not a type", obj.Name())Alan DonovanI would simply do this for now:
check.errorf(e, NotAType, "%s is not a type", obj)
This is good enough for this error.
As a separate and independent CL, I think we can improve error messages that print objects.
I tried that initially, but the error messages were rather unsatisfactory, for example:
```
a.go:5:8: var error error is not a type
```
or in more pathological cases,
```
a.go:5:8: var error func(int, string, bool) (error, []chan int) is not a type
```
Compare with the latest draft of this CL:
```
a.go:5:8: error is a local variable, not a type
a.go:4:6: declaration of error as local variable here shadows a type
```
Agreed it's better (for novices), but it's also very verbose compared to our typical error messages. I am just concerned that we're doing a one-off fix here instead of a more comprehensive review/fix.
I like the objectKind idea (in fact I played with a similar approach). Can we just do something like:
```
a.go:5:8: error (local variable) is not a type
```
That's more inline with what we have already in place.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |