Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Implement Type Simplification v2 #3318

Merged
merged 8 commits into from Mar 31, 2017
Merged

Implement Type Simplification v2 #3318

merged 8 commits into from Mar 31, 2017

Conversation

ghost
Copy link

@ghost ghost commented Mar 31, 2017

Fixes #3184

@ghost ghost requested review from arv and aboodman and removed request for aboodman March 31, 2017 01:50
Copy link
Contributor

@arv arv left a comment

Choose a reason for hiding this comment

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

I also added a t.Skip() in TestNewCommit. Is that passing now?

We can also simplify simplifyStruct now but I'm OK doing all of this in a follow up PR if this one now works.

return t, false
}

return newType(CompoundDesc{t.Kind(), newElemTypes}, tc.nextTypeId()), true
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why we don't want to intern this?

for i, f := range desc.fields {
newType, c := removeAndCollectStructFields(tc, f.Type, seen, pendingStructs)
newFields[i] = StructField{Name: f.Name, Type: newType, Optional: f.Optional}
changed = changed || c
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like we are using this changed. We should probably use it below to determine if we want to use the old desc.fields instead of newFields

Copy link
Contributor

Choose a reason for hiding this comment

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

I fixed it but I'm not sure it is worth it here... Maybe it would be better to remove the change out param from removeAndCollectStructFields.

@aboodman
Copy link
Contributor

I'm OK with this approach. Defer to @arv for review.

@arv
Copy link
Contributor

arv commented Mar 31, 2017

I see you removed both the skips from #3313

@rafael-atticlabs I added a commit to this PR... (by pushing to rafael-atticlabs/typeSimplification2)

@arv
Copy link
Contributor

arv commented Mar 31, 2017

I'm landing this. There is some followup work that needs to be done but I'll do that in different PRs

@arv arv merged commit 1f3d9be into attic-labs:master Mar 31, 2017
@ghost ghost deleted the typeSimplification2 branch March 31, 2017 20:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants