You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
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.ForbiddenMethod
does not match becauseSomeType
is 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
).The text was updated successfully, but these errors were encountered: