-
Notifications
You must be signed in to change notification settings - Fork 56
Intersection Type #1603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intersection Type #1603
Conversation
…n and using union type in BRS mode
|
Accomplishes #1330 |
|
Hey there! I just built a new temporary npm package based on 5e648aa. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.49-intersection-type.20260120154200.tgz |
TwitchBronBron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things, but overall this looks great!
| } | ||
| } | ||
| if (this.checkAny(TokenKind.And, TokenKind.Or)) { | ||
| this.warnIfNotBrighterScriptMode('custom types'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better name than custom types? I know this is configurable, but feels like it would better to say something like intersection or union?
|
Hey there! I just built a new temporary npm package based on d277935. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.49-intersection-type.20260120174746.tgz |
Co-authored-by: Bronley Plumb <bronley@gmail.com>
|
Hey there! I just built a new temporary npm package based on 92a7755. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.49-intersection-type.20260120180333.tgz |
|
Hey there! I just built a new temporary npm package based on db1138c. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.49-intersection-type.20260122131443.tgz |
Adds
IntersectionTypemodelled after TypeScript's intersection typesIntersectionType<type> and <type>(type1 or type2) and (type3 or type4))type foo = myType1 or myType2 and myType3 or myType4=>myType1 or (myType2 and myType3) or myType4type MyKlassAA = MyKlass and roAssociativeArrayworks properly