Skip to content

[Reference] feat: switched Node to a discriminated union - #56274

Closed
Josh Goldberg ✨ (JoshuaKGoldberg) wants to merge 1 commit into
microsoft:mainfrom
JoshuaKGoldberg:node-discriminated-union
Closed

[Reference] feat: switched Node to a discriminated union#56274
Josh Goldberg ✨ (JoshuaKGoldberg) wants to merge 1 commit into
microsoft:mainfrom
JoshuaKGoldberg:node-discriminated-union

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg Josh Goldberg ✨ (JoshuaKGoldberg) commented Oct 31, 2023

Copy link
Copy Markdown
Contributor

Posting as reference for now. Still has build failures. Not ready for review.

Naming is not at all well-thought-out. Names like NodeBase are just what came to mind first.

The most breaking portion of this PR's change is that Node no longer has a parent: Node, because SourceFile has parent: undefined. In retrospect this probably could be split into >= two steps:

  1. Creating a discriminated union, keeping the technically incorrect parent: Node inside SourceFile
  2. Switching parent: Node to parent: undefined inside SourceFile

@Jack-Works

Copy link
Copy Markdown
Contributor

If you're interested, we have discussed this in the engine262 repo. engine262/engine262#215 (comment)

I really hope this can land, but I think there might be performance pushback.

@jakebailey

Copy link
Copy Markdown
Member

Yes; the previous iteration caused check time to triple: #54148

@JoshuaKGoldberg

Copy link
Copy Markdown
Contributor Author

Closing to keep the review queue small.

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

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants