Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Fix assertion panic for type aliases to anonymous structs #134

Merged
merged 2 commits into from
Feb 24, 2021

Conversation

efritz
Copy link
Contributor

@efritz efritz commented Feb 24, 2021

Fixes #133

@efritz efritz requested a review from Strum355 February 24, 2021 19:44
@Strum355 Strum355 marked this pull request as ready for review February 24, 2021 20:05
@Strum355 Strum355 changed the title wip. Fix assertion panic for type aliases to anonymous structs Feb 24, 2021
@Strum355 Strum355 added this to the Code Intelligence Sprint 6 milestone Feb 24, 2021
@Strum355 Strum355 merged commit 6250cc0 into master Feb 24, 2021
@Strum355 Strum355 deleted the ef/name-equals-struct branch February 24, 2021 20:09
@@ -240,49 +240,86 @@ func TestIndexer(t *testing.T) {
if value := strings.ReplaceAll(hover.Result.Contents[2].Value, " ", "\t"); value != expectedUnderlyingType {
t.Errorf("incorrect hover text documentation. want=%q have=%q", expectedUnderlyingType, value)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's actually 3 tests here, should we break these out into different t.Runs?


signature, extra := typeString(f)
if signature != "type TestEqualsStruct = struct" {
t.Errorf("unexpected type string. want=%q have=%q", "type TestEqualsStruct struct", signature)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this fail? I'd expect this to hit typestring.go:50

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests passed 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh the text is wrong here. I'll fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh yes cool cool

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Processor failing during CI/CD
2 participants