microsoft / microsoft/TypeScript
Should not allow `import.defer?.('x')`
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
### 🔎 Search Terms
"import defer"
### 🕗 Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about __6.0.3_______
- I was unable to test this on prior versions because _______
### ⏯ Playground Link
https://www.typescriptlang.org/play/?moduleResolution=99&target=99&ssl=3&ssc=40&pln=2&pc=1#code/JYWwDg9gTgLgBPAZlCI4HIYE8wFMDOAxlMGDOgNwBQVhEAdvvGHALxyiSwB0AJrolxQA-NwAUmHAWKlyASgpA
### 💻 Code
```ts
import.defer?.('x');
```
### 🙁 Actual behavior
No errors.
### 🙂 Expected behavior
Should not allow it as an optional call.
### Additional information about the issue
Parsers like Oxc, Yuku, SWC, Babel all reject it. I didn't read the spec, but unless they are wrong.
Contributor guide
Research direction
Start with the provided TypeScript Playground link and the `import.defer?.('x')` example to reproduce the parser behavior. Trace the parser entry point for import-defer syntax and compare the handling with the rejecting behavior reported for Oxc, Yuku, SWC, and Babel. Done means this code is rejected rather than accepted as an optional call, with a regression test covering it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100