The recently merged semantic analysis has one drawback when dealing with type aliases: they always get replaced with the underlying type. Example:
package somepkg
import "example.com/anotherpkg"
type SomeType = anotherpkg.AnotherType
A pattern somepkg.SomeType.ForbiddenMethod does not match because SomeType is an alias. What works is anotherpkg.AnotherType.ForbiddenMethod.
This is a) unexpected and b) can cause a pattern that works with a version of a package where the type is not an alias to stop working when the packages switches to a type alias.
It would be better if forbidigo matched against both the underlying type (anotherpkg.AnotherType) and the alias (somepkg.SomeType).
The recently merged semantic analysis has one drawback when dealing with type aliases: they always get replaced with the underlying type. Example:
A pattern
somepkg.SomeType.ForbiddenMethoddoes not match becauseSomeTypeis an alias. What works isanotherpkg.AnotherType.ForbiddenMethod.This is a) unexpected and b) can cause a pattern that works with a version of a package where the type is not an alias to stop working when the packages switches to a type alias.
It would be better if forbidigo matched against both the underlying type (
anotherpkg.AnotherType) and the alias (somepkg.SomeType).