Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish generic types #669

Closed
palsivertsen opened this issue Apr 6, 2022 · 0 comments · Fixed by #692
Closed

Distinguish generic types #669

palsivertsen opened this issue Apr 6, 2022 · 0 comments · Fixed by #692

Comments

@palsivertsen
Copy link

Describe the bug
Revive reports receiver name error at first and only declaration.

To Reproduce
Run revive on this code:

package example

type Foo[T any] struct{}

func (f *Foo[T]) Foo() {}

type Bar[T comparable] struct{}

func (b *Bar[T]) Bar() {}
 $ revive --version && revive
version 1.1.4
example.go:9:1: receiver name b should be consistent with previous receiver name f for invalid-type
example.go:3:6: exported type Foo should have comment or be unexported
example.go:7:6: exported type Bar should have comment or be unexported

Expected behavior

  1. I expected to not see any errors regarding receiver types.
  2. The receiver error should not report "invalid-type".

Desktop (please complete the following information):

  • OS: Arch Linux
  • go version go1.18 linux/amd64
tie added a commit to tie/go-pkg that referenced this issue May 28, 2022
The revive linter does not support type parameters with receiver-naming.
See mgechev/revive#669

Uh, also for some reason this bug is marked as a feature request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants