JS model loader doesn’t understand union type alias in ceylon.ast.core
See original GitHub issueceylon compile-js ceylon.ast.samples ceylon.ast.core ceylon.ast.create && ceylon compile-js ceylon.ast.samples
Running this in the ceylon.ast
repository on the version-1.3.1
branch, under the 1.3.1 distribution (e. g. from release or built from the 1.3.1
tag) produces 34 errors of the kind:
error: specified expression must be assignable to declared type of ‘expression’: ‘Expression&AssigningExpression’ (‘Expression’) is not assignable to ‘AssigningExpression’ (‘unknown’) error: argument must be assignable to parameter ‘operand’ of ‘NotOperation’: ‘EqualOperation’ is not assignable to ‘NegatingExpression’ (‘unknown’)
It seems the model loader isn’t loading ceylon.ast
’s precedence aliases (*ingExpression
). @jvasileff reports that ceylon compile-dart
, which also uses the JS model loader, has the same problem.
This blocks the ceylon.ast
1.3.1 release.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Refine to type alias in union - Stack Overflow
First I'm gonna walk through this code just to clarify what's going on: type A = { a: number } type B =...
Read more >[Feature Request] Future-proof always-aliasing/never ... - GitHub
The idea is to create a new type alias that is a union of the original type and the new union elements. However,...
Read more >Type aliases and type inference - Eclipse Ceylon
In this chapter, we're going to discuss type aliases and local type ... If you need to create an alias for a union...
Read more >Elm Models as Types - Charlie Koster - Medium
Elm Models as Types. An idea for using Union Types over Type Aliases. I'm building a small single page application for managing Lightning...
Read more >Type Aliases vs Interfaces in TypeScript - DEV Community
Type aliases can be used to represent not only primitives but also object types, union types, tuples and intersections.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think @lucaswerkmeister’s reduction is a slightly different case where the class’s parameter’s type winds up with a bad resolvedAliases type, whereas in the original case, it was the type alias’s extended type that had a bad resolvedAliases type.
A further reduction of this second scenario is:
and
Note that this one is sensitive to ordering; renaming the alias can cause the error to disappear.
Thanks for investigating this! I managed to boil it down to a shorter example: