Commit 56a1f69
fix(jit): align union type resolution with Angular's typeReferenceToExpression
Angular's reference filters only `null` literal types from union types
and requires exactly one non-null type to remain. Previously we iterated
all union members and returned the first resolvable one, which is more
permissive than Angular's behavior.
With Angular-aligned semantics:
- `T | null` → resolves to T (1 non-null type remains)
- `undefined | T` → unresolvable (2 non-null types remain)
- `null | undefined | T` → unresolvable (2 non-null types remain)
Unresolvable types emit `{ type: undefined }` matching Angular's
`paramType || ts.factory.createIdentifier('undefined')` fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 61b518f commit 56a1f69
File tree
3 files changed
+39
-28
lines changed- crates/oxc_angular_compiler
- src/component
- tests
- snapshots
3 files changed
+39
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6293 | 6293 | | |
6294 | 6294 | | |
6295 | 6295 | | |
6296 | | - | |
6297 | | - | |
6298 | | - | |
6299 | | - | |
| 6296 | + | |
6300 | 6297 | | |
6301 | 6298 | | |
6302 | 6299 | | |
| |||
6307 | 6304 | | |
6308 | 6305 | | |
6309 | 6306 | | |
6310 | | - | |
6311 | | - | |
6312 | | - | |
| 6307 | + | |
| 6308 | + | |
| 6309 | + | |
| 6310 | + | |
| 6311 | + | |
| 6312 | + | |
| 6313 | + | |
| 6314 | + | |
| 6315 | + | |
6313 | 6316 | | |
6314 | 6317 | | |
6315 | 6318 | | |
6316 | 6319 | | |
6317 | 6320 | | |
| 6321 | + | |
6318 | 6322 | | |
6319 | 6323 | | |
6320 | 6324 | | |
6321 | 6325 | | |
6322 | 6326 | | |
6323 | 6327 | | |
| 6328 | + | |
6324 | 6329 | | |
6325 | 6330 | | |
6326 | 6331 | | |
| |||
6329 | 6334 | | |
6330 | 6335 | | |
6331 | 6336 | | |
6332 | | - | |
| 6337 | + | |
6333 | 6338 | | |
6334 | | - | |
6335 | | - | |
| 6339 | + | |
| 6340 | + | |
6336 | 6341 | | |
6337 | 6342 | | |
| 6343 | + | |
| 6344 | + | |
| 6345 | + | |
6338 | 6346 | | |
6339 | | - | |
6340 | | - | |
| 6347 | + | |
| 6348 | + | |
6341 | 6349 | | |
6342 | 6350 | | |
6343 | | - | |
6344 | | - | |
6345 | 6351 | | |
6346 | | - | |
6347 | | - | |
| 6352 | + | |
| 6353 | + | |
6348 | 6354 | | |
6349 | 6355 | | |
6350 | 6356 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
18 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
0 commit comments