Skip to content

Add support for Union types, including completion - #405

Closed
MetaMemoryT wants to merge 9 commits into
ternjs:masterfrom
MetaMemoryT:union-types
Closed

Add support for Union types, including completion#405
MetaMemoryT wants to merge 9 commits into
ternjs:masterfrom
MetaMemoryT:union-types

Conversation

@MetaMemoryT

Copy link
Copy Markdown
Contributor

NOTE: these modifications should be reviewed in the context of google/tern-closure#34

Some Union type functionality requires tern-closure to be tested, (that's why some of the new tests reside in tern-closure) as the doctrine parser is required to parse union types from annotations.

@marijnh

marijnh commented Oct 21, 2014

Copy link
Copy Markdown
Member

I am not convinced this is the right direction. We already have sets of types modeled as AVals with multiple types inside of them. A Type is currently a single, definite type. Adding another mechanism for expressing sets of types at that level seems confusing.

I'd be okay with extending the parser to recognize the | operator as a way to add multiple types to something, and showing small sets (say <4, after merging similar types) of types in that same way in Aval.toString (though I haven't really thought through all the implications of that, I think on the whole it would be a win for clarity).

@MetaMemoryT

Copy link
Copy Markdown
Contributor Author

Thank you for your explanations, I am revising my code and investigating how I could use AVals to achieve the same functionality.

@RReverser

Copy link
Copy Markdown

Did this go anywhere in the end?

@MetaMemoryT

Copy link
Copy Markdown
Contributor Author

I realized I need to get funding to spend anymore time on this.

@marijnh marijnh closed this Nov 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants