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

go/types: invalid types may still be unexpanded #49857

Closed
findleyr opened this issue Nov 29, 2021 · 1 comment
Closed

go/types: invalid types may still be unexpanded #49857

findleyr opened this issue Nov 29, 2021 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@findleyr
Copy link
Contributor

Repro:

func TestUnnamedUnderlying(t *testing.T) {
	const src = `
package p

type Bad Bad // invalid type
`
	pkg, _ := pkgForMode("p", src, nil, 0)
	Bad := pkg.Scope().Lookup("Bad").Type()

	if _, isNamed := Bad.Underlying().(*types.Named); isNamed {
		panic("named!")
	}
}

After type checking, the underlying of Bad is still defined. Somehow our mechanism to prevent this is failing.

CC @griesemer

@findleyr findleyr added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Nov 29, 2021
@findleyr findleyr added this to the Go1.18 milestone Nov 29, 2021
@findleyr findleyr self-assigned this Nov 29, 2021
@findleyr
Copy link
Contributor Author

Err, nevermind: due to the proximity to the beta I'm too quick to file.

This is because we are bailing out in this test set-up. I don't think we can expect that types are fully set-up after a bail out.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants