pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/AssemblyScript/assemblyscript/commit/1847c8fe409cbbf4b57a694198d09a3482174e65

hub.githubassets.com/assets/global-d18f184ea1a06a2c.css" /> fix: report error for mulitple union type (#2872) · AssemblyScript/assemblyscript@1847c8f · GitHub
Skip to content

Commit 1847c8f

Browse files
authored
fix: report error for mulitple union type (#2872)
1 parent 4bd1c12 commit 1847c8f

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ export class Parser extends DiagnosticEmitter {
631631
}
632632
// ... | type
633633
while (tn.skip(Token.Bar)) {
634-
let nextType = this.parseType(tn, false, true);
634+
let nextType = this.parseType(tn, true, false);
635635
if (!nextType) return null;
636636
let typeIsNull = type.kind == NodeKind.NamedType && (<NamedTypeNode>type).isNull;
637637
let nextTypeIsNull = nextType.kind == NodeKind.NamedType && (<NamedTypeNode>nextType).isNull;

tests/parser/union.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export function foo(a: aaa | bbb | ccc): i32 {
2+
return 1;
3+
}
4+
5+
export function bar(a: i32 | u32 | f32): i32 {
6+
return 1;
7+
}
8+
9+
export let a: i32 | u32 | f32 | null = 1;

tests/parser/union.ts.fixture.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export let a = 1;
2+
// ERROR 100: "Not implemented: union types" in union.ts(1,36+3)
3+
// ERROR 100: "Not implemented: union types" in union.ts(5,36+3)
4+
// ERROR 100: "Not implemented: union types" in union.ts(9,27+10)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy