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

False positive result #246

Open
potalestor opened this issue May 20, 2024 · 1 comment
Open

False positive result #246

potalestor opened this issue May 20, 2024 · 1 comment
Labels
false positive Requires more analysis and support good first issue Good for newcomers

Comments

@potalestor
Copy link

package main

import "fmt"

type S struct{}

type SS []*S

type C struct{}

type CC []*C

func (ss SS) Convert() CC {
	cc := make(CC, len(ss))
	for i := range ss {
		cc[i] = &C{}
	}

	return cc
}

func main() {
	var ss SS

	fmt.Println(ss.Convert())
}
@sonalmahajan15
Copy link
Contributor

@potalestor, this seems to be a corner case that is not correctly handled for named type receivers. We'll add a fix for it soon. Thanks for reporting!

@sonalmahajan15 sonalmahajan15 added good first issue Good for newcomers false positive Requires more analysis and support labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false positive Requires more analysis and support good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants