mvdan/gogrep

Using types not in the standard library

Closed this issue · 1 comments

mvdan commented

For example, gogrep -x '$(n type(*Node))' - even with type(*gc.Node) - crashes in cmd/compile/internal/gc.

mvdan commented

Types not in the standard library actually work fine, most of the time. This query fails because the gc package has a test file as a gc_test package that doesn't import gc, hence it has no way to reach the gc.Node type.

The solution will likely be to resolve types globally at the beginning of the command, erroring if we find zero or multiple matching types. That would have covered the edge case.