diff --git a/.github/workflows/accept-baselines-fix-lints.yaml b/.github/workflows/accept-baselines-fix-lints.yaml index 0328f0b3cf701..4f3ee8ef0767b 100644 --- a/.github/workflows/accept-baselines-fix-lints.yaml +++ b/.github/workflows/accept-baselines-fix-lints.yaml @@ -17,10 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96a5ae6050ac2..388db63970372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ defaults: jobs: test: strategy: - fail-fast: false + fail-fast: ${{ github.event_name == 'merge_group' }} matrix: config: # Main builds @@ -46,6 +46,7 @@ jobs: - os: ubuntu-latest node-version: '22' bundle: true + skip: ${{ github.event_name == 'merge_group' }} - os: windows-latest node-version: '22' bundle: true @@ -58,6 +59,7 @@ jobs: - os: ubuntu-latest node-version: '20' bundle: true + skip: ${{ github.event_name == 'merge_group' }} - os: windows-latest node-version: '20' bundle: true @@ -70,6 +72,7 @@ jobs: - os: ubuntu-latest node-version: '18' bundle: true + skip: ${{ github.event_name == 'merge_group' }} - os: windows-latest node-version: '18' bundle: true @@ -82,6 +85,7 @@ jobs: - os: ubuntu-latest node-version: '16' bundle: true + skip: ${{ github.event_name == 'merge_group' }} - os: windows-latest node-version: '16' bundle: true @@ -117,9 +121,9 @@ jobs: name: Test Node ${{ matrix.config.node-version }} on ${{ matrix.config.os }}${{ (!matrix.config.bundle && ' with --no-bundle') || '' }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Use node version ${{ matrix.config.node-version }} - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: ${{ matrix.config.node-version }} check-latest: true @@ -150,8 +154,8 @@ jobs: contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -160,12 +164,12 @@ jobs: run: npm test -- --no-lint --coverage - name: Upload coverage artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: coverage path: coverage - - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} disable_search: true @@ -175,8 +179,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -188,8 +192,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -201,13 +205,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci - - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ~/.cache/dprint key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }} @@ -218,11 +222,13 @@ jobs: run: npx dprint check browser-integration: + if: ${{ github.event_name != 'merge_group' }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -237,8 +243,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -250,9 +256,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | @@ -291,16 +297,16 @@ jobs: if: github.event_name == 'pull_request' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: path: pr - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: path: base ref: ${{ github.base_ref }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | @@ -316,24 +322,30 @@ jobs: working-directory: ./pr - run: npm ci + id: base-npm-ci + continue-on-error: true working-directory: ./base - run: npx hereby lkg working-directory: ./pr - run: npx hereby lkg + id: base-lkg + continue-on-error: true + if: ${{ steps.base-npm-ci.outcome == 'success' }} working-directory: ./base - run: | echo "See $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID for more info." node ./pr/scripts/checkPackageSize.mjs ./base ./pr >> $GITHUB_STEP_SUMMARY + if: ${{ steps.base-lkg.outcome == 'success' }} misc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -348,8 +360,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -369,8 +381,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: npm ci @@ -406,7 +418,7 @@ jobs: - name: Upload baseline diff artifact if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }} - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: fix_baselines.patch path: fix_baselines.patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fef7f3cd80f81..d715312240f51 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,11 +42,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2 + uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2 + uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2 + uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8 diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 976b2a2e9e650..5c8c2dd2485b2 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -15,8 +15,8 @@ jobs: # You can define any steps you want, and they will run before the agent starts. # If you do not check out your code, Copilot will do this for you. steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - run: npm ci # pull dprint caches before network access is blocked - run: npx hereby check-format || true diff --git a/.github/workflows/create-cherry-pick-pr.yml b/.github/workflows/create-cherry-pick-pr.yml index c5304b4d728f7..47c2be940481d 100644 --- a/.github/workflows/create-cherry-pick-pr.yml +++ b/.github/workflows/create-cherry-pick-pr.yml @@ -47,7 +47,7 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. diff --git a/.github/workflows/insiders.yaml b/.github/workflows/insiders.yaml index e8bdc5072ac1f..9c27709dae89b 100644 --- a/.github/workflows/insiders.yaml +++ b/.github/workflows/insiders.yaml @@ -20,8 +20,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | @@ -42,8 +42,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' # Use NODE_AUTH_TOKEN environment variable to authenticate to this registry. diff --git a/.github/workflows/lkg.yml b/.github/workflows/lkg.yml index 625ae46df36fc..3d1d1f50d27c8 100644 --- a/.github/workflows/lkg.yml +++ b/.github/workflows/lkg.yml @@ -27,11 +27,11 @@ jobs: exit 1 fi - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ inputs.branch_name }} token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml index 6aee0bfad78cf..7d96198753384 100644 --- a/.github/workflows/new-release-branch.yaml +++ b/.github/workflows/new-release-branch.yaml @@ -50,12 +50,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 85473eb07ac5d..faa9f3d615a73 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -21,8 +21,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | @@ -42,8 +42,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' # Use NODE_AUTH_TOKEN environment variable to authenticate to this registry. diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index cc96f55d16dd9..70ccb39435a83 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | @@ -44,7 +44,7 @@ jobs: npm pack ./ mv typescript-*.tgz typescript.tgz - name: Upload built tarfile - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: tgz path: typescript.tgz diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 34aed594af047..b5c0239a9301d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -29,7 +29,7 @@ jobs: steps: - name: 'Checkout code' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false @@ -47,7 +47,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: 'Upload artifact' - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: SARIF file path: results.sarif @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2 + uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8 with: sarif_file: results.sarif diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml index f0a6988e283c0..77455eb3c7bd2 100644 --- a/.github/workflows/set-version.yaml +++ b/.github/workflows/set-version.yaml @@ -49,11 +49,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ inputs.branch_name }} token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml index 20ee1fb6cbb30..62c27289ebc94 100644 --- a/.github/workflows/sync-branch.yaml +++ b/.github/workflows/sync-branch.yaml @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ inputs.branch_name }} filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ diff --git a/.github/workflows/sync-wiki.yml b/.github/workflows/sync-wiki.yml index 87d23cd1ef272..610f8170127e7 100644 --- a/.github/workflows/sync-wiki.yml +++ b/.github/workflows/sync-wiki.yml @@ -18,7 +18,7 @@ jobs: - name: Get repo name run: R=${GITHUB_REPOSITORY%?wiki}; echo "BASENAME=${R##*/}" >> $GITHUB_ENV - name: Checkout ${{ env.BASENAME }}-wiki - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: repository: '${{ GITHUB.repository_owner }}/${{ env.BASENAME }}-wiki' token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index dd6017c93398f..414be032b6d80 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -51,13 +51,13 @@ jobs: runs-on: ubuntu-latest steps: - if: ${{ github.event.inputs.bisect }} - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. - if: ${{ !github.event.inputs.bisect }} - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - uses: microsoft/TypeScript-Twoslash-Repro-Action@master diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml index 1b34c1935ba48..7fa5d6ad6bf6f 100644 --- a/.github/workflows/update-package-lock.yaml +++ b/.github/workflows/update-package-lock.yaml @@ -22,10 +22,10 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: 'lts/*' - run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3c755bb6d526a..5c6ed85bba785 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,7 @@ +# Note + +🚨 **Important** 🚨: All code changes should be submitted to the https://github.com/microsoft/typescript-go repo. Development in this codebase [is winding down](https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#typescript-6.0-is-the-last-javascript-based-release) and PRs will only be merged if they fix **critical** 6.0 issues (at minimum, any bug that existed in 5.9 is not critical unless it's a security issue). + # Instructions for Logging Issues ## 1. Read the FAQ @@ -45,7 +49,7 @@ In general, things we find useful when reviewing suggestions are: * Code examples showing the generated JavaScript (if applicable) * If relevant, precedent in other languages can be useful for establishing context and expected behavior -# Instructions for Contributing Code +# Instructions for Contributing Code (Legacy) ## What You'll Need diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 0f4f8344008b2..aca96dc28c911 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -601,7 +601,7 @@ export const knip = task({ name: "knip", description: "Runs knip.", dependencies: [generateDiagnostics], - run: () => exec(process.execPath, ["node_modules/knip/bin/knip.js", "--tags=+internal,-knipignore", "--exclude=duplicates,enumMembers", ...(cmdLineOptions.fix ? ["--fix"] : [])]), + run: () => exec(process.execPath, ["node_modules/knip/bin/knip.js", ...(cmdLineOptions.fix ? ["--fix"] : [])]), }); const { main: typingsInstaller, watch: watchTypingsInstaller } = entrypointBuildTask({ diff --git a/SECURITY.md b/SECURITY.md index b3c89efc852e2..d8e8bb9ca18a3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations. If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. @@ -12,9 +12,7 @@ If you believe you have found a security vulnerability in any Microsoft-owned re Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). +You should receive a response within 24 hours. If for some reason you do not, please follow up using the messaging functionality found at the bottom of the Activity tab on your vulnerability report on [https://msrc.microsoft.com/report/vulnerability](https://msrc.microsoft.com/report/vulnerability/) or via email as described in the instructions at the bottom of [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc) or on MSRC's [FAQ page for reporting an issue](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: diff --git a/knip.jsonc b/knip.jsonc index 5b1fa410e15da..5badeb83e5c01 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -1,5 +1,7 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", + "exclude": ["duplicates", "enumMembers"], + "tags": ["+internal", "-knipignore"], "includeEntryExports": true, "entry": [ "Herebyfile.mjs", @@ -14,7 +16,6 @@ "src/testRunner/_namespaces/Harness.ts", // The rest of the entry files, mostly to track used dependencies: - ".eslint-plugin-local.cjs", ".gulp.js", "scripts/eslint/{rules,tests}/*.cjs", "scripts/*.{cjs,mjs}" diff --git a/package-lock.json b/package-lock.json index 6e0bc60ef577f..cc12134142e4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,45 +16,45 @@ "@dprint/formatter": "^0.4.1", "@dprint/typescript": "0.93.4", "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.33.0", - "@octokit/rest": "^21.1.1", + "@eslint/js": "^9.39.1", + "@octokit/rest": "^22.0.1", "@types/chai": "^4.3.20", "@types/minimist": "^1.2.5", "@types/mocha": "^10.0.10", - "@types/ms": "^0.7.34", + "@types/ms": "^2.1.0", "@types/node": "latest", "@types/source-map-support": "^0.5.10", "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.39.1", - "@typescript-eslint/type-utils": "^8.39.1", - "@typescript-eslint/utils": "^8.39.1", + "@typescript-eslint/rule-tester": "^8.47.0", + "@typescript-eslint/type-utils": "^8.47.0", + "@typescript-eslint/utils": "^8.47.0", "azure-devops-node-api": "^15.1.1", "c8": "^10.1.3", "chai": "^4.5.0", "chokidar": "^4.0.3", "diff": "^8.0.2", "dprint": "^0.49.1", - "esbuild": "^0.25.9", - "eslint": "^9.33.0", + "esbuild": "^0.27.0", + "eslint": "^9.39.1", "eslint-formatter-autolinkable-stylish": "^1.4.0", "eslint-plugin-regexp": "^2.10.0", - "fast-xml-parser": "^5.2.5", - "glob": "^10.4.5", - "globals": "^16.3.0", - "hereby": "^1.11.0", + "fast-xml-parser": "^5.3.2", + "glob": "^10.5.0", + "globals": "^16.5.0", + "hereby": "^1.11.1", "jsonc-parser": "^3.3.1", - "knip": "^5.62.0", + "knip": "^5.70.0", "minimist": "^1.2.8", "mocha": "^10.8.2", "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.12.6", + "monocart-coverage-reports": "^2.12.9", "ms": "^2.1.3", "picocolors": "^1.1.1", - "playwright": "^1.54.2", + "playwright": "^1.56.1", "source-map-support": "^0.5.21", "tslib": "^2.8.1", - "typescript": "^5.9.2", - "typescript-eslint": "^8.39.1", + "typescript": "^5.9.3", + "typescript-eslint": "^8.47.0", "which": "^3.0.1" }, "engines": { @@ -200,20 +200,20 @@ ] }, "node_modules/@emnapi/core": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", - "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz", + "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", "dev": true, "optional": true, "dependencies": { - "@emnapi/wasi-threads": "1.0.4", + "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", - "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", "dev": true, "optional": true, "dependencies": { @@ -221,9 +221,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", - "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "dev": true, "optional": true, "dependencies": { @@ -231,9 +231,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", - "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.0.tgz", + "integrity": "sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==", "cpu": [ "ppc64" ], @@ -247,9 +247,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", - "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.0.tgz", + "integrity": "sha512-j67aezrPNYWJEOHUNLPj9maeJte7uSMM6gMoxfPC9hOg8N02JuQi/T7ewumf4tNvJadFkvLZMlAq73b9uwdMyQ==", "cpu": [ "arm" ], @@ -263,9 +263,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", - "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.0.tgz", + "integrity": "sha512-CC3vt4+1xZrs97/PKDkl0yN7w8edvU2vZvAFGD16n9F0Cvniy5qvzRXjfO1l94efczkkQE6g1x0i73Qf5uthOQ==", "cpu": [ "arm64" ], @@ -279,9 +279,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", - "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.0.tgz", + "integrity": "sha512-wurMkF1nmQajBO1+0CJmcN17U4BP6GqNSROP8t0X/Jiw2ltYGLHpEksp9MpoBqkrFR3kv2/te6Sha26k3+yZ9Q==", "cpu": [ "x64" ], @@ -295,9 +295,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", - "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", + "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", "cpu": [ "arm64" ], @@ -311,9 +311,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", - "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.0.tgz", + "integrity": "sha512-8mG6arH3yB/4ZXiEnXof5MK72dE6zM9cDvUcPtxhUZsDjESl9JipZYW60C3JGreKCEP+p8P/72r69m4AZGJd5g==", "cpu": [ "x64" ], @@ -327,9 +327,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", - "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.0.tgz", + "integrity": "sha512-9FHtyO988CwNMMOE3YIeci+UV+x5Zy8fI2qHNpsEtSF83YPBmE8UWmfYAQg6Ux7Gsmd4FejZqnEUZCMGaNQHQw==", "cpu": [ "arm64" ], @@ -343,9 +343,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", - "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.0.tgz", + "integrity": "sha512-zCMeMXI4HS/tXvJz8vWGexpZj2YVtRAihHLk1imZj4efx1BQzN76YFeKqlDr3bUWI26wHwLWPd3rwh6pe4EV7g==", "cpu": [ "x64" ], @@ -359,9 +359,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", - "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.0.tgz", + "integrity": "sha512-t76XLQDpxgmq2cNXKTVEB7O7YMb42atj2Re2Haf45HkaUpjM2J0UuJZDuaGbPbamzZ7bawyGFUkodL+zcE+jvQ==", "cpu": [ "arm" ], @@ -375,9 +375,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", - "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.0.tgz", + "integrity": "sha512-AS18v0V+vZiLJyi/4LphvBE+OIX682Pu7ZYNsdUHyUKSoRwdnOsMf6FDekwoAFKej14WAkOef3zAORJgAtXnlQ==", "cpu": [ "arm64" ], @@ -391,9 +391,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", - "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.0.tgz", + "integrity": "sha512-Mz1jxqm/kfgKkc/KLHC5qIujMvnnarD9ra1cEcrs7qshTUSksPihGrWHVG5+osAIQ68577Zpww7SGapmzSt4Nw==", "cpu": [ "ia32" ], @@ -407,9 +407,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", - "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.0.tgz", + "integrity": "sha512-QbEREjdJeIreIAbdG2hLU1yXm1uu+LTdzoq1KCo4G4pFOLlvIspBm36QrQOar9LFduavoWX2msNFAAAY9j4BDg==", "cpu": [ "loong64" ], @@ -423,9 +423,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", - "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.0.tgz", + "integrity": "sha512-sJz3zRNe4tO2wxvDpH/HYJilb6+2YJxo/ZNbVdtFiKDufzWq4JmKAiHy9iGoLjAV7r/W32VgaHGkk35cUXlNOg==", "cpu": [ "mips64el" ], @@ -439,9 +439,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", - "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.0.tgz", + "integrity": "sha512-z9N10FBD0DCS2dmSABDBb5TLAyF1/ydVb+N4pi88T45efQ/w4ohr/F/QYCkxDPnkhkp6AIpIcQKQ8F0ANoA2JA==", "cpu": [ "ppc64" ], @@ -455,9 +455,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", - "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.0.tgz", + "integrity": "sha512-pQdyAIZ0BWIC5GyvVFn5awDiO14TkT/19FTmFcPdDec94KJ1uZcmFs21Fo8auMXzD4Tt+diXu1LW1gHus9fhFQ==", "cpu": [ "riscv64" ], @@ -471,9 +471,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", - "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.0.tgz", + "integrity": "sha512-hPlRWR4eIDDEci953RI1BLZitgi5uqcsjKMxwYfmi4LcwyWo2IcRP+lThVnKjNtk90pLS8nKdroXYOqW+QQH+w==", "cpu": [ "s390x" ], @@ -487,9 +487,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", - "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.0.tgz", + "integrity": "sha512-1hBWx4OUJE2cab++aVZ7pObD6s+DK4mPGpemtnAORBvb5l/g5xFGk0vc0PjSkrDs0XaXj9yyob3d14XqvnQ4gw==", "cpu": [ "x64" ], @@ -503,9 +503,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", - "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.0.tgz", + "integrity": "sha512-6m0sfQfxfQfy1qRuecMkJlf1cIzTOgyaeXaiVaaki8/v+WB+U4hc6ik15ZW6TAllRlg/WuQXxWj1jx6C+dfy3w==", "cpu": [ "arm64" ], @@ -519,9 +519,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", - "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.0.tgz", + "integrity": "sha512-xbbOdfn06FtcJ9d0ShxxvSn2iUsGd/lgPIO2V3VZIPDbEaIj1/3nBBe1AwuEZKXVXkMmpr6LUAgMkLD/4D2PPA==", "cpu": [ "x64" ], @@ -535,9 +535,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", - "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.0.tgz", + "integrity": "sha512-fWgqR8uNbCQ/GGv0yhzttj6sU/9Z5/Sv/VGU3F5OuXK6J6SlriONKrQ7tNlwBrJZXRYk5jUhuWvF7GYzGguBZQ==", "cpu": [ "arm64" ], @@ -551,9 +551,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", - "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.0.tgz", + "integrity": "sha512-aCwlRdSNMNxkGGqQajMUza6uXzR/U0dIl1QmLjPtRbLOx3Gy3otfFu/VjATy4yQzo9yFDGTxYDo1FfAD9oRD2A==", "cpu": [ "x64" ], @@ -567,9 +567,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", - "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.0.tgz", + "integrity": "sha512-nyvsBccxNAsNYz2jVFYwEGuRRomqZ149A39SHWk4hV0jWxKM0hjBPm3AmdxcbHiFLbBSwG6SbpIcUbXjgyECfA==", "cpu": [ "arm64" ], @@ -583,9 +583,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", - "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.0.tgz", + "integrity": "sha512-Q1KY1iJafM+UX6CFEL+F4HRTgygmEW568YMqDA5UV97AuZSm21b7SXIrRJDwXWPzr8MGr75fUZPV67FdtMHlHA==", "cpu": [ "x64" ], @@ -599,9 +599,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", - "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.0.tgz", + "integrity": "sha512-W1eyGNi6d+8kOmZIwi/EDjrL9nxQIQ0MiGqe/AWc6+IaHloxHSGoeRgDRKHFISThLmsewZ5nHFvGFWdBYlgKPg==", "cpu": [ "arm64" ], @@ -615,9 +615,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", - "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.0.tgz", + "integrity": "sha512-30z1aKL9h22kQhilnYkORFYt+3wp7yZsHWus+wSKAJR8JtdfI76LJ4SBdMsCopTR3z/ORqVu5L1vtnHZWVj4cQ==", "cpu": [ "ia32" ], @@ -631,9 +631,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", - "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.0.tgz", + "integrity": "sha512-aIitBcjQeyOhMTImhLZmtxfdOcuNRpwlPNmlFKPcHQYPhEssw75Cl1TSXJXpMkzaua9FUetx/4OQKq7eJul5Cg==", "cpu": [ "x64" ], @@ -673,9 +673,9 @@ "dev": true }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" @@ -691,21 +691,21 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -736,18 +736,21 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, + "dependencies": { + "@eslint/core": "^0.17.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.15" @@ -814,9 +817,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.33.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz", - "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz", + "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -826,21 +829,21 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "dependencies": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.17.0", "levn": "^0.4.1" }, "engines": { @@ -857,31 +860,18 @@ } }, "node_modules/@humanfs/node": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "dev": true, "dependencies": { "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.3.0" + "@humanwhocodes/retry": "^0.4.0" }, "engines": { "node": ">=18.18.0" } }, - "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "dev": true, - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -950,9 +940,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.30", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz", - "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -960,15 +950,15 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.3.tgz", - "integrity": "sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz", + "integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==", "dev": true, "optional": true, "dependencies": { - "@emnapi/core": "^1.4.5", - "@emnapi/runtime": "^1.4.5", - "@tybys/wasm-util": "^0.10.0" + "@emnapi/core": "^1.5.0", + "@emnapi/runtime": "^1.5.0", + "@tybys/wasm-util": "^0.10.1" } }, "node_modules/@nodelib/fs.scandir": { @@ -1007,193 +997,163 @@ } }, "node_modules/@octokit/auth-token": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz", - "integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", "dev": true, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/core": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.6.tgz", - "integrity": "sha512-kIU8SLQkYWGp3pVKiYzA5OSaNF5EE03P/R8zEmmrG6XwOg5oBjXyQVVIauQ0dgau4zYhpZEhJrvIYt6oM+zZZA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", + "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, "dependencies": { - "@octokit/auth-token": "^5.0.0", - "@octokit/graphql": "^8.2.2", - "@octokit/request": "^9.2.3", - "@octokit/request-error": "^6.1.8", - "@octokit/types": "^14.0.0", - "before-after-hook": "^3.0.2", + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.3", + "@octokit/request": "^10.0.6", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/endpoint": { - "version": "10.1.4", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", - "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", + "integrity": "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==", "dev": true, "dependencies": { - "@octokit/types": "^14.0.0", + "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/graphql": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.2.2.tgz", - "integrity": "sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", + "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", "dev": true, "dependencies": { - "@octokit/request": "^9.2.3", - "@octokit/types": "^14.0.0", + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/openapi-types": { - "version": "25.1.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", - "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", + "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { - "version": "11.6.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.6.0.tgz", - "integrity": "sha512-n5KPteiF7pWKgBIBJSk8qzoZWcUkza2O6A0za97pMGVrGfPdltxrfmfF5GucHYvHGZD8BdaZmmHGz5cX/3gdpw==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", + "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", "dev": true, "dependencies": { - "@octokit/types": "^13.10.0" + "@octokit/types": "^16.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" }, "peerDependencies": { "@octokit/core": ">=6" } }, - "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { - "version": "24.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", - "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", - "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^24.2.0" - } - }, "node_modules/@octokit/plugin-request-log": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-5.3.1.tgz", - "integrity": "sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-6.0.0.tgz", + "integrity": "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==", "dev": true, "engines": { - "node": ">= 18" + "node": ">= 20" }, "peerDependencies": { "@octokit/core": ">=6" } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.5.0.tgz", - "integrity": "sha512-9Pas60Iv9ejO3WlAX3maE1+38c5nqbJXV5GrncEfkndIpZrJ/WPMRd2xYDcPPEt5yzpxcjw9fWNoPhsSGzqKqw==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz", + "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==", "dev": true, "dependencies": { - "@octokit/types": "^13.10.0" + "@octokit/types": "^16.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" }, "peerDependencies": { "@octokit/core": ">=6" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { - "version": "24.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", - "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "dev": true - }, - "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", - "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^24.2.0" - } - }, "node_modules/@octokit/request": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.4.tgz", - "integrity": "sha512-q8ybdytBmxa6KogWlNa818r0k1wlqzNC+yNkcQDECHvQo8Vmstrg18JwqJHdJdUiHD2sjlwBgSm9kHkOKe2iyA==", + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.7.tgz", + "integrity": "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==", "dev": true, "dependencies": { - "@octokit/endpoint": "^10.1.4", - "@octokit/request-error": "^6.1.8", - "@octokit/types": "^14.0.0", - "fast-content-type-parse": "^2.0.0", + "@octokit/endpoint": "^11.0.2", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/request-error": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz", - "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", + "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", "dev": true, "dependencies": { - "@octokit/types": "^14.0.0" + "@octokit/types": "^16.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/rest": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-21.1.1.tgz", - "integrity": "sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.1.tgz", + "integrity": "sha512-Jzbhzl3CEexhnivb1iQ0KJ7s5vvjMWcmRtq5aUsKmKDrRW6z3r84ngmiFKFvpZjpiU/9/S6ITPFRpn5s/3uQJw==", "dev": true, "dependencies": { - "@octokit/core": "^6.1.4", - "@octokit/plugin-paginate-rest": "^11.4.2", - "@octokit/plugin-request-log": "^5.3.1", - "@octokit/plugin-rest-endpoint-methods": "^13.3.0" + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-request-log": "^6.0.0", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@octokit/types": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", - "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", "dev": true, "dependencies": { - "@octokit/openapi-types": "^25.1.0" + "@octokit/openapi-types": "^27.0.0" } }, "node_modules/@oxc-resolver/binding-android-arm-eabi": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.6.1.tgz", - "integrity": "sha512-Ma/kg29QJX1Jzelv0Q/j2iFuUad1WnjgPjpThvjqPjpOyLjCUaiFCCnshhmWjyS51Ki1Iol3fjf1qAzObf8GIA==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.13.2.tgz", + "integrity": "sha512-vWd1NEaclg/t2DtEmYzRRBNQOueMI8tixw/fSNZ9XETXLRJiAjQMYpYeflQdRASloGze6ZelHE/wIBNt4S+pkw==", "cpu": [ "arm" ], @@ -1204,9 +1164,9 @@ ] }, "node_modules/@oxc-resolver/binding-android-arm64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.6.1.tgz", - "integrity": "sha512-xjL/FKKc5p8JkFWiH7pJWSzsewif3fRf1rw2qiRxRvq1uIa6l7Zoa14Zq2TNWEsqDjdeOrlJtfWiPNRnevK0oQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.13.2.tgz", + "integrity": "sha512-jxZrYcxgpI6IuQpguQVAQNrZfUyiYfMVqR4pKVU3PRLCM7AsfXNKp0TIgcvp+l6dYVdoZ1MMMMa5Ayjd09rNOw==", "cpu": [ "arm64" ], @@ -1217,9 +1177,9 @@ ] }, "node_modules/@oxc-resolver/binding-darwin-arm64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.6.1.tgz", - "integrity": "sha512-u0yrJ3NHE0zyCjiYpIyz4Vmov21MA0yFKbhHgixDU/G6R6nvC8ZpuSFql3+7C8ttAK9p8WpqOGweepfcilH5Bw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.13.2.tgz", + "integrity": "sha512-RDS3HUe1FvgjNS1xfBUqiEJ8938Zb5r7iKABwxEblp3K4ufZZNAtoaHjdUH2TJ0THDmuf0OxxVUO/Y+4Ep4QfQ==", "cpu": [ "arm64" ], @@ -1230,9 +1190,9 @@ ] }, "node_modules/@oxc-resolver/binding-darwin-x64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.6.1.tgz", - "integrity": "sha512-2lox165h1EhzxcC8edUy0znXC/hnAbUPaMpYKVlzLpB2AoYmgU4/pmofFApj+axm2FXpNamjcppld8EoHo06rw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.13.2.tgz", + "integrity": "sha512-tDcyWtkUzkt6auJLP2dOjL84BxqHkKW4mz2lNRIGPTq7b+HBraB+m8RdRH6BgqTvbnNECOxR3XAMaKBKC8J51g==", "cpu": [ "x64" ], @@ -1243,9 +1203,9 @@ ] }, "node_modules/@oxc-resolver/binding-freebsd-x64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.6.1.tgz", - "integrity": "sha512-F45MhEQ7QbHfsvZtVNuA/9obu3il7QhpXYmCMfxn7Zt9nfAOw4pQ8hlS5DroHVp3rW35u9F7x0sixk/QEAi3qQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.13.2.tgz", + "integrity": "sha512-fpaeN8Q0kWvKns9uSMg6CcKo7cdgmWt6J91stPf8sdM+EKXzZ0YcRnWWyWF8SM16QcLUPCy5Iwt5Z8aYBGaZYA==", "cpu": [ "x64" ], @@ -1256,9 +1216,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.6.1.tgz", - "integrity": "sha512-r+3+MTTl0tD4NoWbfTIItAxJvuyIU7V0fwPDXrv7Uj64vZ3OYaiyV+lVaeU89Bk/FUUQxeUpWBwdKNKHjyRNQw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.13.2.tgz", + "integrity": "sha512-idBgJU5AvSsGOeaIWiFBKbNBjpuduHsJmrG4CBbEUNW/Ykx+ISzcuj1PHayiYX6R9stVsRhj3d2PyymfC5KWRg==", "cpu": [ "arm" ], @@ -1269,9 +1229,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.6.1.tgz", - "integrity": "sha512-TBTZ63otsWZ72Z8ZNK2JVS0HW1w9zgOixJTFDNrYPUUW1pXGa28KAjQ1yGawj242WLAdu3lwdNIWtkxeO2BLxQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.13.2.tgz", + "integrity": "sha512-BlBvQUhvvIM/7s96KlKhMk0duR2sj8T7Hyii46/5QnwfN/pHwobvOL5czZ6/SKrHNB/F/qDY4hGsBuB1y7xgTg==", "cpu": [ "arm" ], @@ -1282,9 +1242,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.6.1.tgz", - "integrity": "sha512-SjwhNynjSG2yMdyA0f7wz7Yvo3ppejO+ET7n2oiI7ApCXrwxMzeRWjBzQt+oVWr2HzVOfaEcDS9rMtnR83ulig==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.13.2.tgz", + "integrity": "sha512-lUmDTmYOGpbIK+FBfZ0ySaQTo7g1Ia/WnDnQR2wi/0AtehZIg/ZZIgiT/fD0iRvKEKma612/0PVo8dXdAKaAGA==", "cpu": [ "arm64" ], @@ -1295,9 +1255,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-arm64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.6.1.tgz", - "integrity": "sha512-f4EMidK6rosInBzPMnJ0Ri4RttFCvvLNUNDFUBtELW/MFkBwPTDlvbsmW0u0Mk/ruBQ2WmRfOZ6tT62kWMcX2Q==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.13.2.tgz", + "integrity": "sha512-dkGzOxo+I9lA4Er6qzFgkFevl3JvwyI9i0T/PkOJHva04rb1p9dz8GPogTO9uMK4lrwLWzm/piAu+tHYC7v7+w==", "cpu": [ "arm64" ], @@ -1308,9 +1268,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.6.1.tgz", - "integrity": "sha512-1umENVKeUsrWnf5IlF/6SM7DCv8G6CoKI2LnYR6qhZuLYDPS4PBZ0Jow3UDV9Rtbv5KRPcA3/uXjI88ntWIcOQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.13.2.tgz", + "integrity": "sha512-53kWsjLkVFnoSA7COdps38pBssN48zI8LfsOvupsmQ0/4VeMYb+0Ao9O6r52PtmFZsGB3S1Qjqbjl/Pswj1a3g==", "cpu": [ "ppc64" ], @@ -1321,9 +1281,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.6.1.tgz", - "integrity": "sha512-Hjyp1FRdJhsEpIxsZq5VcDuFc8abC0Bgy8DWEa31trCKoTz7JqA7x3E2dkFbrAKsEFmZZ0NvuG5Ip3oIRARhow==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.13.2.tgz", + "integrity": "sha512-MfxN6DMpvmdCbGlheJ+ihy11oTcipqDfcEIQV9ah3FGXBRCZtBOHJpQDk8qI2Y+nCXVr3Nln7OSsOzoC4+rSYQ==", "cpu": [ "riscv64" ], @@ -1334,9 +1294,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.6.1.tgz", - "integrity": "sha512-ODJOJng6f3QxpAXhLel3kyWs8rPsJeo9XIZHzA7p//e+5kLMDU7bTVk4eZnUHuxsqsB8MEvPCicJkKCEuur5Ag==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.13.2.tgz", + "integrity": "sha512-WXrm4YiRU0ijqb72WHSjmfYaQZ7t6/kkQrFc4JtU+pUE4DZA/DEdxOuQEd4Q43VqmLvICTJWSaZMlCGQ4PSRUg==", "cpu": [ "riscv64" ], @@ -1347,9 +1307,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.6.1.tgz", - "integrity": "sha512-hCzRiLhqe1ZOpHTsTGKp7gnMJRORlbCthawBueer2u22RVAka74pV/+4pP1tqM07mSlQn7VATuWaDw9gCl+cVg==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.13.2.tgz", + "integrity": "sha512-4pISWIlOFRUhWyvGCB3XUhtcwyvwGGhlXhHz7IXCXuGufaQtvR05trvw8U1ZnaPhsdPBkRhOMIedX11ayi5uXw==", "cpu": [ "s390x" ], @@ -1360,9 +1320,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-x64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.6.1.tgz", - "integrity": "sha512-JansPD8ftOzMYIC3NfXJ68tt63LEcIAx44Blx6BAd7eY880KX7A0KN3hluCrelCz5aQkPaD95g8HBiJmKaEi2w==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.13.2.tgz", + "integrity": "sha512-DVo6jS8n73yNAmCsUOOk2vBeC60j2RauDXQM8p7RDl0afsEaA2le22vD8tky7iNoM5tsxfBmE4sOJXEKgpwWRw==", "cpu": [ "x64" ], @@ -1373,9 +1333,9 @@ ] }, "node_modules/@oxc-resolver/binding-linux-x64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.6.1.tgz", - "integrity": "sha512-R78ES1rd4z2x5NrFPtSWb/ViR1B8wdl+QN2X8DdtoYcqZE/4tvWtn9ZTCXMEzUp23tchJ2wUB+p6hXoonkyLpA==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.13.2.tgz", + "integrity": "sha512-6WqrE+hQBFP35KdwQjWcZpldbTq6yJmuTVThISu+rY3+j6MaDp2ciLHTr1X68r2H/7ocOIl4k3NnOVIzeRJE3w==", "cpu": [ "x64" ], @@ -1386,25 +1346,25 @@ ] }, "node_modules/@oxc-resolver/binding-wasm32-wasi": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.6.1.tgz", - "integrity": "sha512-qAR3tYIf3afkij/XYunZtlz3OH2Y4ni10etmCFIJB5VRGsqJyI6Hl+2dXHHGJNwbwjXjSEH/KWJBpVroF3TxBw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.13.2.tgz", + "integrity": "sha512-YpxvQmP2D+mNUkLQZbBjGz20g/pY8XoOBdPPoWMl9X68liFFjXxkPQTrZxWw4zzG/UkTM5z6dPRTyTePRsMcjw==", "cpu": [ "wasm32" ], "dev": true, "optional": true, "dependencies": { - "@napi-rs/wasm-runtime": "^1.0.1" + "@napi-rs/wasm-runtime": "^1.0.7" }, "engines": { "node": ">=14.0.0" } }, "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.6.1.tgz", - "integrity": "sha512-QqygWygIuemGkaBA48POOTeinbVvlamqh6ucm8arGDGz/mB5O00gXWxed12/uVrYEjeqbMkla/CuL3fjL3EKvw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.13.2.tgz", + "integrity": "sha512-1SKBw6KcCmvPBdEw1/Qdpv6eSDf23lCXTWz9VxTe6QUQ/1wR+HZR2uS4q6C8W6jnIswMTQbxpTvVwdRXl+ufeA==", "cpu": [ "arm64" ], @@ -1415,9 +1375,9 @@ ] }, "node_modules/@oxc-resolver/binding-win32-ia32-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.6.1.tgz", - "integrity": "sha512-N2+kkWwt/bk0JTCxhPuK8t8JMp3nd0n2OhwOkU8KO4a7roAJEa4K1SZVjMv5CqUIr5sx2CxtXRBoFDiORX5oBg==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.13.2.tgz", + "integrity": "sha512-KEVV7wggDucxRn3vvyHnmTCPXoCT7vWpH18UVLTygibHJvNRP2zl5lBaQcCIdIaYYZjKt1aGI/yZqxZvHoiCdg==", "cpu": [ "ia32" ], @@ -1428,9 +1388,9 @@ ] }, "node_modules/@oxc-resolver/binding-win32-x64-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.6.1.tgz", - "integrity": "sha512-DfMg3cU9bJUbN62Prbp4fGCtLgexuwyEaQGtZAp8xmi1Ii26uflOGx0FJkFTF6lVMSFoIRFvIL8gsw5/ZdHrMw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.13.2.tgz", + "integrity": "sha512-6AAdN9v/wO5c3td1yidgNLKYlzuNgfOtEqBq60WE469bJWR7gHgG/S5aLR2pH6/gyPLs9UXtItxi934D+0Estg==", "cpu": [ "x64" ], @@ -1451,9 +1411,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", - "integrity": "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", "dev": true, "optional": true, "dependencies": { @@ -1497,18 +1457,18 @@ "dev": true }, "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true }, "node_modules/@types/node": { - "version": "24.2.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.1.tgz", - "integrity": "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==", + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, "dependencies": { - "undici-types": "~7.10.0" + "undici-types": "~7.16.0" } }, "node_modules/@types/source-map-support": { @@ -1527,16 +1487,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.1.tgz", - "integrity": "sha512-yYegZ5n3Yr6eOcqgj2nJH8cH/ZZgF+l0YIdKILSDjYFRjgYQMgv/lRjV5Z7Up04b9VYUondt8EPMqg7kTWgJ2g==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.47.0.tgz", + "integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/type-utils": "8.39.1", - "@typescript-eslint/utils": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/type-utils": "8.47.0", + "@typescript-eslint/utils": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -1550,7 +1510,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.39.1", + "@typescript-eslint/parser": "^8.47.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -1565,15 +1525,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.1.tgz", - "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.47.0.tgz", + "integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4" }, "engines": { @@ -1589,13 +1549,13 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.39.1.tgz", - "integrity": "sha512-8fZxek3ONTwBu9ptw5nCKqZOSkXshZB7uAxuFF0J/wTMkKydjXCzqqga7MlFMpHi9DoG4BadhmTkITBcg8Aybw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.47.0.tgz", + "integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==", "dev": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.39.1", - "@typescript-eslint/types": "^8.39.1", + "@typescript-eslint/tsconfig-utils": "^8.47.0", + "@typescript-eslint/types": "^8.47.0", "debug": "^4.3.4" }, "engines": { @@ -1610,14 +1570,14 @@ } }, "node_modules/@typescript-eslint/rule-tester": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.39.1.tgz", - "integrity": "sha512-I3iYy48LdtopHts4OpBb2qTysLPlv5JcqU61Zv6mtD6Zlo++oXpRb2WzIFjQRqUKHELo8VNnm1QdweN6TbTZ+A==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.47.0.tgz", + "integrity": "sha512-NpCv7bGe7+CY+DwwU7mhp3mTwpvELEyvbQxh8nKimCHdthEYHL993SHzPQNiJx17NePvQOmilE1ohjav3SdEdQ==", "dev": true, "dependencies": { - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/parser": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -1635,13 +1595,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.39.1.tgz", - "integrity": "sha512-RkBKGBrjgskFGWuyUGz/EtD8AF/GW49S21J8dvMzpJitOF1slLEbbHnNEtAHtnDAnx8qDEdRrULRnWVx27wGBw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.47.0.tgz", + "integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1" + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1652,9 +1612,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.1.tgz", - "integrity": "sha512-ePUPGVtTMR8XMU2Hee8kD0Pu4NDE1CN9Q1sxGSGd/mbOtGZDM7pnhXNJnzW63zk/q+Z54zVzj44HtwXln5CvHA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.47.0.tgz", + "integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1668,14 +1628,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.39.1.tgz", - "integrity": "sha512-gu9/ahyatyAdQbKeHnhT4R+y3YLtqqHyvkfDxaBYk97EcbfChSJXyaJnIL3ygUv7OuZatePHmQvuH5ru0lnVeA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.47.0.tgz", + "integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -1692,9 +1652,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.39.1.tgz", - "integrity": "sha512-7sPDKQQp+S11laqTrhHqeAbsCfMkwJMrV7oTDvtDds4mEofJYir414bYKUEb8YPUm9QL3U+8f6L6YExSoAGdQw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.47.0.tgz", + "integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1705,15 +1665,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.1.tgz", - "integrity": "sha512-EKkpcPuIux48dddVDXyQBlKdeTPMmALqBUbEk38McWv0qVEZwOpVJBi7ugK5qVNgeuYjGNQxrrnoM/5+TI/BPw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.47.0.tgz", + "integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==", "dev": true, "dependencies": { - "@typescript-eslint/project-service": "8.39.1", - "@typescript-eslint/tsconfig-utils": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/project-service": "8.47.0", + "@typescript-eslint/tsconfig-utils": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1733,15 +1693,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.39.1.tgz", - "integrity": "sha512-VF5tZ2XnUSTuiqZFXCZfZs1cgkdd3O/sSYmdo2EpSyDlC86UM/8YytTmKnehOW3TGAlivqTDT6bS87B/GQ/jyg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.47.0.tgz", + "integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1" + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1756,12 +1716,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.1.tgz", - "integrity": "sha512-W8FQi6kEh2e8zVhQ0eeRnxdvIoOkAp/CPAahcNio6nO9dsIwb9b34z90KOlheoyuVf6LSOEdjlkxSkapNEc+4A==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.47.0.tgz", + "integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/types": "8.47.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -1855,9 +1815,9 @@ } }, "node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "engines": { "node": ">=12" @@ -1950,9 +1910,9 @@ "dev": true }, "node_modules/before-after-hook": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", - "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz", + "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==", "dev": true }, "node_modules/binary-extensions": { @@ -2321,12 +2281,12 @@ } }, "node_modules/commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", "dev": true, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/comment-parser": { @@ -2386,9 +2346,9 @@ } }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "dependencies": { "ms": "^2.1.3" @@ -2544,9 +2504,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", - "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", + "integrity": "sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2556,32 +2516,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.9", - "@esbuild/android-arm": "0.25.9", - "@esbuild/android-arm64": "0.25.9", - "@esbuild/android-x64": "0.25.9", - "@esbuild/darwin-arm64": "0.25.9", - "@esbuild/darwin-x64": "0.25.9", - "@esbuild/freebsd-arm64": "0.25.9", - "@esbuild/freebsd-x64": "0.25.9", - "@esbuild/linux-arm": "0.25.9", - "@esbuild/linux-arm64": "0.25.9", - "@esbuild/linux-ia32": "0.25.9", - "@esbuild/linux-loong64": "0.25.9", - "@esbuild/linux-mips64el": "0.25.9", - "@esbuild/linux-ppc64": "0.25.9", - "@esbuild/linux-riscv64": "0.25.9", - "@esbuild/linux-s390x": "0.25.9", - "@esbuild/linux-x64": "0.25.9", - "@esbuild/netbsd-arm64": "0.25.9", - "@esbuild/netbsd-x64": "0.25.9", - "@esbuild/openbsd-arm64": "0.25.9", - "@esbuild/openbsd-x64": "0.25.9", - "@esbuild/openharmony-arm64": "0.25.9", - "@esbuild/sunos-x64": "0.25.9", - "@esbuild/win32-arm64": "0.25.9", - "@esbuild/win32-ia32": "0.25.9", - "@esbuild/win32-x64": "0.25.9" + "@esbuild/aix-ppc64": "0.27.0", + "@esbuild/android-arm": "0.27.0", + "@esbuild/android-arm64": "0.27.0", + "@esbuild/android-x64": "0.27.0", + "@esbuild/darwin-arm64": "0.27.0", + "@esbuild/darwin-x64": "0.27.0", + "@esbuild/freebsd-arm64": "0.27.0", + "@esbuild/freebsd-x64": "0.27.0", + "@esbuild/linux-arm": "0.27.0", + "@esbuild/linux-arm64": "0.27.0", + "@esbuild/linux-ia32": "0.27.0", + "@esbuild/linux-loong64": "0.27.0", + "@esbuild/linux-mips64el": "0.27.0", + "@esbuild/linux-ppc64": "0.27.0", + "@esbuild/linux-riscv64": "0.27.0", + "@esbuild/linux-s390x": "0.27.0", + "@esbuild/linux-x64": "0.27.0", + "@esbuild/netbsd-arm64": "0.27.0", + "@esbuild/netbsd-x64": "0.27.0", + "@esbuild/openbsd-arm64": "0.27.0", + "@esbuild/openbsd-x64": "0.27.0", + "@esbuild/openharmony-arm64": "0.27.0", + "@esbuild/sunos-x64": "0.27.0", + "@esbuild/win32-arm64": "0.27.0", + "@esbuild/win32-ia32": "0.27.0", + "@esbuild/win32-x64": "0.27.0" } }, "node_modules/escalade": { @@ -2606,24 +2566,23 @@ } }, "node_modules/eslint": { - "version": "9.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.33.0.tgz", - "integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", + "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.33.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.39.1", + "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -2833,9 +2792,9 @@ } }, "node_modules/fast-content-type-parse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", - "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", + "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==", "dev": true, "funding": [ { @@ -2895,9 +2854,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", - "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.2.tgz", + "integrity": "sha512-n8v8b6p4Z1sMgqRmqLJm3awW4NX7NkaKPfb3uJIBTSH7Pdvufi3PQ3/lJLQrvxcMYl7JI2jnDO90siPEpD8JBA==", "dev": true, "funding": [ { @@ -3024,9 +2983,9 @@ } }, "node_modules/formatly": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.2.4.tgz", - "integrity": "sha512-lIN7GpcvX/l/i24r/L9bnJ0I8Qn01qijWpQpDDvTLL29nKqSaJJu4h20+7VJ6m2CAhQ2/En/GbxDiHCzq/0MyA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.3.0.tgz", + "integrity": "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==", "dev": true, "dependencies": { "fd-package-json": "^2.0.0" @@ -3123,9 +3082,9 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -3155,9 +3114,9 @@ } }, "node_modules/globals": { - "version": "16.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.3.0.tgz", - "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==", + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", "dev": true, "engines": { "node": ">=18" @@ -3227,9 +3186,9 @@ } }, "node_modules/hereby": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/hereby/-/hereby-1.11.0.tgz", - "integrity": "sha512-Tdp03ueQL3w5eZCrQVW4POBDxg9ldjNyFrZYWt6ndMha5agyRUO8b+irOEG3B1RSS9/2LxSjjyG6DSxITouJzA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/hereby/-/hereby-1.11.1.tgz", + "integrity": "sha512-3tcp92aUN6mSmWslo/EIoz3AAKa9GPmiJ3g0ZgXC8NGZPyh4J3T+JoGfD4JTiL31SW+pFliKKHu1uxa7nwDv0g==", "dev": true, "dependencies": { "command-line-usage": "^6.1.3", @@ -3413,9 +3372,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -3441,9 +3400,9 @@ } }, "node_modules/jiti": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", - "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "bin": { "jiti": "lib/jiti-cli.mjs" @@ -3456,9 +3415,9 @@ "dev": true }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "dependencies": { "argparse": "^2.0.1" @@ -3468,9 +3427,9 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", - "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.8.0.tgz", + "integrity": "sha512-iZ8Bdb84lWRuGHamRXFyML07r21pcwBrLkHEuHgEY5UbCouBwv7ECknDRKzsQIXMiqpPymqtIf8TC/shYKB5rw==", "dev": true, "engines": { "node": ">=12.0.0" @@ -3510,9 +3469,9 @@ } }, "node_modules/knip": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/knip/-/knip-5.62.0.tgz", - "integrity": "sha512-hfTUVzmrMNMT1khlZfAYmBABeehwWUUrizLQoLamoRhSFkygsGIXWx31kaWKBgEaIVL77T3Uz7IxGvSw+CvQ6A==", + "version": "5.70.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.70.0.tgz", + "integrity": "sha512-ZRO7GzegusadOqR0ICxEQfbM1RS+1Uu/LtATpzO71pHXZQnoj4K47/QtuCtfvJVjWb2R4a7YwHv+Ey9xoxjQCw==", "dev": true, "funding": [ { @@ -3522,26 +3481,21 @@ { "type": "opencollective", "url": "https://opencollective.com/knip" - }, - { - "type": "polar", - "url": "https://polar.sh/webpro-nl" } ], "dependencies": { "@nodelib/fs.walk": "^1.2.3", "fast-glob": "^3.3.3", - "formatly": "^0.2.4", - "jiti": "^2.4.2", - "js-yaml": "^4.1.0", + "formatly": "^0.3.0", + "jiti": "^2.6.0", + "js-yaml": "^4.1.1", "minimist": "^1.2.8", - "oxc-resolver": "^11.1.0", + "oxc-resolver": "^11.13.2", "picocolors": "^1.1.1", "picomatch": "^4.0.1", - "smol-toml": "^1.3.4", - "strip-json-comments": "5.0.2", - "zod": "^3.22.4", - "zod-validation-error": "^3.0.3" + "smol-toml": "^1.5.2", + "strip-json-comments": "5.0.3", + "zod": "^4.1.11" }, "bin": { "knip": "bin/knip.js", @@ -3552,13 +3506,13 @@ }, "peerDependencies": { "@types/node": ">=18", - "typescript": ">=5.0.4" + "typescript": ">=5.0.4 <7" } }, "node_modules/knip/node_modules/strip-json-comments": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.2.tgz", - "integrity": "sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", "dev": true, "engines": { "node": ">=14.16" @@ -3989,21 +3943,21 @@ } }, "node_modules/monocart-coverage-reports": { - "version": "2.12.6", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.6.tgz", - "integrity": "sha512-96CMC4B+Rw5Yi8OH2Aot+aMYIw84fK3PNJs7nP9Yw07I0+k0lY1GGiPOJTt123GMDdSpS32lPUIMu/OyqOfBCA==", + "version": "2.12.9", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.9.tgz", + "integrity": "sha512-vtFqbC3Egl4nVa1FSIrQvMPO6HZtb9lo+3IW7/crdvrLNW2IH8lUsxaK0TsKNmMO2mhFWwqQywLV2CZelqPgwA==", "dev": true, "dependencies": { - "acorn": "^8.14.1", - "acorn-loose": "^8.5.0", + "acorn": "^8.15.0", + "acorn-loose": "^8.5.2", "acorn-walk": "^8.3.4", - "commander": "^13.1.0", + "commander": "^14.0.0", "console-grid": "^2.2.3", "eight-colors": "^1.3.1", "foreground-child": "^3.3.1", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.7", + "istanbul-reports": "^3.2.0", "lz-utils": "^2.1.0", "monocart-locator": "^1.0.2" }, @@ -4023,21 +3977,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/napi-postinstall": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.3.tgz", - "integrity": "sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow==", - "dev": true, - "bin": { - "napi-postinstall": "lib/cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/napi-postinstall" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4092,37 +4031,33 @@ } }, "node_modules/oxc-resolver": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.6.1.tgz", - "integrity": "sha512-WQgmxevT4cM5MZ9ioQnEwJiHpPzbvntV5nInGAKo9NQZzegcOonHvcVcnkYqld7bTG35UFHEKeF7VwwsmA3cZg==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.13.2.tgz", + "integrity": "sha512-1SXVyYQ9bqMX3uZo8Px81EG7jhZkO9PvvR5X9roY5TLYVm4ZA7pbPDNlYaDBBeF9U+YO3OeMNoHde52hrcCu8w==", "dev": true, - "hasInstallScript": true, - "dependencies": { - "napi-postinstall": "^0.3.0" - }, "funding": { "url": "https://github.com/sponsors/Boshen" }, "optionalDependencies": { - "@oxc-resolver/binding-android-arm-eabi": "11.6.1", - "@oxc-resolver/binding-android-arm64": "11.6.1", - "@oxc-resolver/binding-darwin-arm64": "11.6.1", - "@oxc-resolver/binding-darwin-x64": "11.6.1", - "@oxc-resolver/binding-freebsd-x64": "11.6.1", - "@oxc-resolver/binding-linux-arm-gnueabihf": "11.6.1", - "@oxc-resolver/binding-linux-arm-musleabihf": "11.6.1", - "@oxc-resolver/binding-linux-arm64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-arm64-musl": "11.6.1", - "@oxc-resolver/binding-linux-ppc64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-riscv64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-riscv64-musl": "11.6.1", - "@oxc-resolver/binding-linux-s390x-gnu": "11.6.1", - "@oxc-resolver/binding-linux-x64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-x64-musl": "11.6.1", - "@oxc-resolver/binding-wasm32-wasi": "11.6.1", - "@oxc-resolver/binding-win32-arm64-msvc": "11.6.1", - "@oxc-resolver/binding-win32-ia32-msvc": "11.6.1", - "@oxc-resolver/binding-win32-x64-msvc": "11.6.1" + "@oxc-resolver/binding-android-arm-eabi": "11.13.2", + "@oxc-resolver/binding-android-arm64": "11.13.2", + "@oxc-resolver/binding-darwin-arm64": "11.13.2", + "@oxc-resolver/binding-darwin-x64": "11.13.2", + "@oxc-resolver/binding-freebsd-x64": "11.13.2", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.13.2", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.13.2", + "@oxc-resolver/binding-linux-arm64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-arm64-musl": "11.13.2", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-riscv64-musl": "11.13.2", + "@oxc-resolver/binding-linux-s390x-gnu": "11.13.2", + "@oxc-resolver/binding-linux-x64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-x64-musl": "11.13.2", + "@oxc-resolver/binding-wasm32-wasi": "11.13.2", + "@oxc-resolver/binding-win32-arm64-msvc": "11.13.2", + "@oxc-resolver/binding-win32-ia32-msvc": "11.13.2", + "@oxc-resolver/binding-win32-x64-msvc": "11.13.2" } }, "node_modules/p-limit": { @@ -4247,12 +4182,12 @@ } }, "node_modules/playwright": { - "version": "1.54.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.2.tgz", - "integrity": "sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", + "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", "dev": true, "dependencies": { - "playwright-core": "1.54.2" + "playwright-core": "1.56.1" }, "bin": { "playwright": "cli.js" @@ -4265,9 +4200,9 @@ } }, "node_modules/playwright-core": { - "version": "1.54.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.2.tgz", - "integrity": "sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", + "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -4501,9 +4436,9 @@ } }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -4627,9 +4562,9 @@ } }, "node_modules/smol-toml": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", - "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.5.2.tgz", + "integrity": "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==", "dev": true, "engines": { "node": ">= 18" @@ -4717,9 +4652,9 @@ } }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -4895,9 +4830,9 @@ } }, "node_modules/typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4908,15 +4843,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.39.1.tgz", - "integrity": "sha512-GDUv6/NDYngUlNvwaHM1RamYftxf782IyEDbdj3SeaIHHv8fNQVRC++fITT7kUJV/5rIA/tkoRSSskt6osEfqg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.47.0.tgz", + "integrity": "sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.39.1", - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1" + "@typescript-eslint/eslint-plugin": "8.47.0", + "@typescript-eslint/parser": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4946,9 +4881,9 @@ "dev": true }, "node_modules/undici-types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", - "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "dev": true }, "node_modules/universal-user-agent": { @@ -5109,9 +5044,9 @@ } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, "engines": { "node": ">=12" @@ -5231,25 +5166,13 @@ } }, "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz", + "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } - }, - "node_modules/zod-validation-error": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.5.3.tgz", - "integrity": "sha512-OT5Y8lbUadqVZCsnyFaTQ4/O2mys4tj7PqhdbBCp7McPwvIEKfPtdA6QfPeFQK2/Rz5LgwmAXRJTugBNBi0btw==", - "dev": true, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "zod": "^3.25.0 || ^4.0.0" - } } }, "dependencies": { @@ -5335,20 +5258,20 @@ "optional": true }, "@emnapi/core": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", - "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz", + "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", "dev": true, "optional": true, "requires": { - "@emnapi/wasi-threads": "1.0.4", + "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "@emnapi/runtime": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", - "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", "dev": true, "optional": true, "requires": { @@ -5356,9 +5279,9 @@ } }, "@emnapi/wasi-threads": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", - "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "dev": true, "optional": true, "requires": { @@ -5366,184 +5289,184 @@ } }, "@esbuild/aix-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", - "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.0.tgz", + "integrity": "sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==", "dev": true, "optional": true }, "@esbuild/android-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", - "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.0.tgz", + "integrity": "sha512-j67aezrPNYWJEOHUNLPj9maeJte7uSMM6gMoxfPC9hOg8N02JuQi/T7ewumf4tNvJadFkvLZMlAq73b9uwdMyQ==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", - "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.0.tgz", + "integrity": "sha512-CC3vt4+1xZrs97/PKDkl0yN7w8edvU2vZvAFGD16n9F0Cvniy5qvzRXjfO1l94efczkkQE6g1x0i73Qf5uthOQ==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", - "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.0.tgz", + "integrity": "sha512-wurMkF1nmQajBO1+0CJmcN17U4BP6GqNSROP8t0X/Jiw2ltYGLHpEksp9MpoBqkrFR3kv2/te6Sha26k3+yZ9Q==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", - "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", + "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", - "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.0.tgz", + "integrity": "sha512-8mG6arH3yB/4ZXiEnXof5MK72dE6zM9cDvUcPtxhUZsDjESl9JipZYW60C3JGreKCEP+p8P/72r69m4AZGJd5g==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", - "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.0.tgz", + "integrity": "sha512-9FHtyO988CwNMMOE3YIeci+UV+x5Zy8fI2qHNpsEtSF83YPBmE8UWmfYAQg6Ux7Gsmd4FejZqnEUZCMGaNQHQw==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", - "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.0.tgz", + "integrity": "sha512-zCMeMXI4HS/tXvJz8vWGexpZj2YVtRAihHLk1imZj4efx1BQzN76YFeKqlDr3bUWI26wHwLWPd3rwh6pe4EV7g==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", - "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.0.tgz", + "integrity": "sha512-t76XLQDpxgmq2cNXKTVEB7O7YMb42atj2Re2Haf45HkaUpjM2J0UuJZDuaGbPbamzZ7bawyGFUkodL+zcE+jvQ==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", - "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.0.tgz", + "integrity": "sha512-AS18v0V+vZiLJyi/4LphvBE+OIX682Pu7ZYNsdUHyUKSoRwdnOsMf6FDekwoAFKej14WAkOef3zAORJgAtXnlQ==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", - "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.0.tgz", + "integrity": "sha512-Mz1jxqm/kfgKkc/KLHC5qIujMvnnarD9ra1cEcrs7qshTUSksPihGrWHVG5+osAIQ68577Zpww7SGapmzSt4Nw==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", - "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.0.tgz", + "integrity": "sha512-QbEREjdJeIreIAbdG2hLU1yXm1uu+LTdzoq1KCo4G4pFOLlvIspBm36QrQOar9LFduavoWX2msNFAAAY9j4BDg==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", - "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.0.tgz", + "integrity": "sha512-sJz3zRNe4tO2wxvDpH/HYJilb6+2YJxo/ZNbVdtFiKDufzWq4JmKAiHy9iGoLjAV7r/W32VgaHGkk35cUXlNOg==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", - "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.0.tgz", + "integrity": "sha512-z9N10FBD0DCS2dmSABDBb5TLAyF1/ydVb+N4pi88T45efQ/w4ohr/F/QYCkxDPnkhkp6AIpIcQKQ8F0ANoA2JA==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", - "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.0.tgz", + "integrity": "sha512-pQdyAIZ0BWIC5GyvVFn5awDiO14TkT/19FTmFcPdDec94KJ1uZcmFs21Fo8auMXzD4Tt+diXu1LW1gHus9fhFQ==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", - "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.0.tgz", + "integrity": "sha512-hPlRWR4eIDDEci953RI1BLZitgi5uqcsjKMxwYfmi4LcwyWo2IcRP+lThVnKjNtk90pLS8nKdroXYOqW+QQH+w==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", - "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.0.tgz", + "integrity": "sha512-1hBWx4OUJE2cab++aVZ7pObD6s+DK4mPGpemtnAORBvb5l/g5xFGk0vc0PjSkrDs0XaXj9yyob3d14XqvnQ4gw==", "dev": true, "optional": true }, "@esbuild/netbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", - "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.0.tgz", + "integrity": "sha512-6m0sfQfxfQfy1qRuecMkJlf1cIzTOgyaeXaiVaaki8/v+WB+U4hc6ik15ZW6TAllRlg/WuQXxWj1jx6C+dfy3w==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", - "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.0.tgz", + "integrity": "sha512-xbbOdfn06FtcJ9d0ShxxvSn2iUsGd/lgPIO2V3VZIPDbEaIj1/3nBBe1AwuEZKXVXkMmpr6LUAgMkLD/4D2PPA==", "dev": true, "optional": true }, "@esbuild/openbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", - "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.0.tgz", + "integrity": "sha512-fWgqR8uNbCQ/GGv0yhzttj6sU/9Z5/Sv/VGU3F5OuXK6J6SlriONKrQ7tNlwBrJZXRYk5jUhuWvF7GYzGguBZQ==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", - "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.0.tgz", + "integrity": "sha512-aCwlRdSNMNxkGGqQajMUza6uXzR/U0dIl1QmLjPtRbLOx3Gy3otfFu/VjATy4yQzo9yFDGTxYDo1FfAD9oRD2A==", "dev": true, "optional": true }, "@esbuild/openharmony-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", - "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.0.tgz", + "integrity": "sha512-nyvsBccxNAsNYz2jVFYwEGuRRomqZ149A39SHWk4hV0jWxKM0hjBPm3AmdxcbHiFLbBSwG6SbpIcUbXjgyECfA==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", - "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.0.tgz", + "integrity": "sha512-Q1KY1iJafM+UX6CFEL+F4HRTgygmEW568YMqDA5UV97AuZSm21b7SXIrRJDwXWPzr8MGr75fUZPV67FdtMHlHA==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", - "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.0.tgz", + "integrity": "sha512-W1eyGNi6d+8kOmZIwi/EDjrL9nxQIQ0MiGqe/AWc6+IaHloxHSGoeRgDRKHFISThLmsewZ5nHFvGFWdBYlgKPg==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", - "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.0.tgz", + "integrity": "sha512-30z1aKL9h22kQhilnYkORFYt+3wp7yZsHWus+wSKAJR8JtdfI76LJ4SBdMsCopTR3z/ORqVu5L1vtnHZWVj4cQ==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", - "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.0.tgz", + "integrity": "sha512-aIitBcjQeyOhMTImhLZmtxfdOcuNRpwlPNmlFKPcHQYPhEssw75Cl1TSXJXpMkzaua9FUetx/4OQKq7eJul5Cg==", "dev": true, "optional": true }, @@ -5574,27 +5497,27 @@ "dev": true }, "@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "requires": { "eslint-visitor-keys": "^3.4.3" } }, "@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true }, "@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "requires": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -5621,15 +5544,18 @@ } }, "@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", - "dev": true + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "requires": { + "@eslint/core": "^0.17.0" + } }, "@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.15" @@ -5680,24 +5606,24 @@ } }, "@eslint/js": { - "version": "9.33.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz", - "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz", + "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==", "dev": true }, "@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true }, "@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "requires": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.17.0", "levn": "^0.4.1" } }, @@ -5708,21 +5634,13 @@ "dev": true }, "@humanfs/node": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "dev": true, "requires": { "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.3.0" - }, - "dependencies": { - "@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "dev": true - } + "@humanwhocodes/retry": "^0.4.0" } }, "@humanwhocodes/module-importer": { @@ -5770,9 +5688,9 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.30", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz", - "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.1.0", @@ -5780,15 +5698,15 @@ } }, "@napi-rs/wasm-runtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.3.tgz", - "integrity": "sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz", + "integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==", "dev": true, "optional": true, "requires": { - "@emnapi/core": "^1.4.5", - "@emnapi/runtime": "^1.4.5", - "@tybys/wasm-util": "^0.10.0" + "@emnapi/core": "^1.5.0", + "@emnapi/runtime": "^1.5.0", + "@tybys/wasm-util": "^0.10.1" } }, "@nodelib/fs.scandir": { @@ -5818,288 +5736,254 @@ } }, "@octokit/auth-token": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.2.tgz", - "integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", "dev": true }, "@octokit/core": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.6.tgz", - "integrity": "sha512-kIU8SLQkYWGp3pVKiYzA5OSaNF5EE03P/R8zEmmrG6XwOg5oBjXyQVVIauQ0dgau4zYhpZEhJrvIYt6oM+zZZA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", + "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, "requires": { - "@octokit/auth-token": "^5.0.0", - "@octokit/graphql": "^8.2.2", - "@octokit/request": "^9.2.3", - "@octokit/request-error": "^6.1.8", - "@octokit/types": "^14.0.0", - "before-after-hook": "^3.0.2", + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.3", + "@octokit/request": "^10.0.6", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "@octokit/endpoint": { - "version": "10.1.4", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz", - "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", + "integrity": "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==", "dev": true, "requires": { - "@octokit/types": "^14.0.0", + "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "@octokit/graphql": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.2.2.tgz", - "integrity": "sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", + "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", "dev": true, "requires": { - "@octokit/request": "^9.2.3", - "@octokit/types": "^14.0.0", + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "@octokit/openapi-types": { - "version": "25.1.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", - "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", + "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", "dev": true }, "@octokit/plugin-paginate-rest": { - "version": "11.6.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.6.0.tgz", - "integrity": "sha512-n5KPteiF7pWKgBIBJSk8qzoZWcUkza2O6A0za97pMGVrGfPdltxrfmfF5GucHYvHGZD8BdaZmmHGz5cX/3gdpw==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", + "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", "dev": true, "requires": { - "@octokit/types": "^13.10.0" - }, - "dependencies": { - "@octokit/openapi-types": { - "version": "24.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", - "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "dev": true - }, - "@octokit/types": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", - "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "dev": true, - "requires": { - "@octokit/openapi-types": "^24.2.0" - } - } + "@octokit/types": "^16.0.0" } }, "@octokit/plugin-request-log": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-5.3.1.tgz", - "integrity": "sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-6.0.0.tgz", + "integrity": "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==", "dev": true, "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.5.0.tgz", - "integrity": "sha512-9Pas60Iv9ejO3WlAX3maE1+38c5nqbJXV5GrncEfkndIpZrJ/WPMRd2xYDcPPEt5yzpxcjw9fWNoPhsSGzqKqw==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz", + "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==", "dev": true, "requires": { - "@octokit/types": "^13.10.0" - }, - "dependencies": { - "@octokit/openapi-types": { - "version": "24.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", - "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", - "dev": true - }, - "@octokit/types": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", - "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", - "dev": true, - "requires": { - "@octokit/openapi-types": "^24.2.0" - } - } + "@octokit/types": "^16.0.0" } }, "@octokit/request": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.2.4.tgz", - "integrity": "sha512-q8ybdytBmxa6KogWlNa818r0k1wlqzNC+yNkcQDECHvQo8Vmstrg18JwqJHdJdUiHD2sjlwBgSm9kHkOKe2iyA==", + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.7.tgz", + "integrity": "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==", "dev": true, "requires": { - "@octokit/endpoint": "^10.1.4", - "@octokit/request-error": "^6.1.8", - "@octokit/types": "^14.0.0", - "fast-content-type-parse": "^2.0.0", + "@octokit/endpoint": "^11.0.2", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "@octokit/request-error": { - "version": "6.1.8", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz", - "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", + "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", "dev": true, "requires": { - "@octokit/types": "^14.0.0" + "@octokit/types": "^16.0.0" } }, "@octokit/rest": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-21.1.1.tgz", - "integrity": "sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.1.tgz", + "integrity": "sha512-Jzbhzl3CEexhnivb1iQ0KJ7s5vvjMWcmRtq5aUsKmKDrRW6z3r84ngmiFKFvpZjpiU/9/S6ITPFRpn5s/3uQJw==", "dev": true, "requires": { - "@octokit/core": "^6.1.4", - "@octokit/plugin-paginate-rest": "^11.4.2", - "@octokit/plugin-request-log": "^5.3.1", - "@octokit/plugin-rest-endpoint-methods": "^13.3.0" + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-request-log": "^6.0.0", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0" } }, "@octokit/types": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", - "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", "dev": true, "requires": { - "@octokit/openapi-types": "^25.1.0" + "@octokit/openapi-types": "^27.0.0" } }, "@oxc-resolver/binding-android-arm-eabi": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.6.1.tgz", - "integrity": "sha512-Ma/kg29QJX1Jzelv0Q/j2iFuUad1WnjgPjpThvjqPjpOyLjCUaiFCCnshhmWjyS51Ki1Iol3fjf1qAzObf8GIA==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.13.2.tgz", + "integrity": "sha512-vWd1NEaclg/t2DtEmYzRRBNQOueMI8tixw/fSNZ9XETXLRJiAjQMYpYeflQdRASloGze6ZelHE/wIBNt4S+pkw==", "dev": true, "optional": true }, "@oxc-resolver/binding-android-arm64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.6.1.tgz", - "integrity": "sha512-xjL/FKKc5p8JkFWiH7pJWSzsewif3fRf1rw2qiRxRvq1uIa6l7Zoa14Zq2TNWEsqDjdeOrlJtfWiPNRnevK0oQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.13.2.tgz", + "integrity": "sha512-jxZrYcxgpI6IuQpguQVAQNrZfUyiYfMVqR4pKVU3PRLCM7AsfXNKp0TIgcvp+l6dYVdoZ1MMMMa5Ayjd09rNOw==", "dev": true, "optional": true }, "@oxc-resolver/binding-darwin-arm64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.6.1.tgz", - "integrity": "sha512-u0yrJ3NHE0zyCjiYpIyz4Vmov21MA0yFKbhHgixDU/G6R6nvC8ZpuSFql3+7C8ttAK9p8WpqOGweepfcilH5Bw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.13.2.tgz", + "integrity": "sha512-RDS3HUe1FvgjNS1xfBUqiEJ8938Zb5r7iKABwxEblp3K4ufZZNAtoaHjdUH2TJ0THDmuf0OxxVUO/Y+4Ep4QfQ==", "dev": true, "optional": true }, "@oxc-resolver/binding-darwin-x64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.6.1.tgz", - "integrity": "sha512-2lox165h1EhzxcC8edUy0znXC/hnAbUPaMpYKVlzLpB2AoYmgU4/pmofFApj+axm2FXpNamjcppld8EoHo06rw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.13.2.tgz", + "integrity": "sha512-tDcyWtkUzkt6auJLP2dOjL84BxqHkKW4mz2lNRIGPTq7b+HBraB+m8RdRH6BgqTvbnNECOxR3XAMaKBKC8J51g==", "dev": true, "optional": true }, "@oxc-resolver/binding-freebsd-x64": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.6.1.tgz", - "integrity": "sha512-F45MhEQ7QbHfsvZtVNuA/9obu3il7QhpXYmCMfxn7Zt9nfAOw4pQ8hlS5DroHVp3rW35u9F7x0sixk/QEAi3qQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.13.2.tgz", + "integrity": "sha512-fpaeN8Q0kWvKns9uSMg6CcKo7cdgmWt6J91stPf8sdM+EKXzZ0YcRnWWyWF8SM16QcLUPCy5Iwt5Z8aYBGaZYA==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-arm-gnueabihf": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.6.1.tgz", - "integrity": "sha512-r+3+MTTl0tD4NoWbfTIItAxJvuyIU7V0fwPDXrv7Uj64vZ3OYaiyV+lVaeU89Bk/FUUQxeUpWBwdKNKHjyRNQw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.13.2.tgz", + "integrity": "sha512-idBgJU5AvSsGOeaIWiFBKbNBjpuduHsJmrG4CBbEUNW/Ykx+ISzcuj1PHayiYX6R9stVsRhj3d2PyymfC5KWRg==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-arm-musleabihf": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.6.1.tgz", - "integrity": "sha512-TBTZ63otsWZ72Z8ZNK2JVS0HW1w9zgOixJTFDNrYPUUW1pXGa28KAjQ1yGawj242WLAdu3lwdNIWtkxeO2BLxQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.13.2.tgz", + "integrity": "sha512-BlBvQUhvvIM/7s96KlKhMk0duR2sj8T7Hyii46/5QnwfN/pHwobvOL5czZ6/SKrHNB/F/qDY4hGsBuB1y7xgTg==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-arm64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.6.1.tgz", - "integrity": "sha512-SjwhNynjSG2yMdyA0f7wz7Yvo3ppejO+ET7n2oiI7ApCXrwxMzeRWjBzQt+oVWr2HzVOfaEcDS9rMtnR83ulig==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.13.2.tgz", + "integrity": "sha512-lUmDTmYOGpbIK+FBfZ0ySaQTo7g1Ia/WnDnQR2wi/0AtehZIg/ZZIgiT/fD0iRvKEKma612/0PVo8dXdAKaAGA==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-arm64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.6.1.tgz", - "integrity": "sha512-f4EMidK6rosInBzPMnJ0Ri4RttFCvvLNUNDFUBtELW/MFkBwPTDlvbsmW0u0Mk/ruBQ2WmRfOZ6tT62kWMcX2Q==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.13.2.tgz", + "integrity": "sha512-dkGzOxo+I9lA4Er6qzFgkFevl3JvwyI9i0T/PkOJHva04rb1p9dz8GPogTO9uMK4lrwLWzm/piAu+tHYC7v7+w==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-ppc64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.6.1.tgz", - "integrity": "sha512-1umENVKeUsrWnf5IlF/6SM7DCv8G6CoKI2LnYR6qhZuLYDPS4PBZ0Jow3UDV9Rtbv5KRPcA3/uXjI88ntWIcOQ==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.13.2.tgz", + "integrity": "sha512-53kWsjLkVFnoSA7COdps38pBssN48zI8LfsOvupsmQ0/4VeMYb+0Ao9O6r52PtmFZsGB3S1Qjqbjl/Pswj1a3g==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-riscv64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.6.1.tgz", - "integrity": "sha512-Hjyp1FRdJhsEpIxsZq5VcDuFc8abC0Bgy8DWEa31trCKoTz7JqA7x3E2dkFbrAKsEFmZZ0NvuG5Ip3oIRARhow==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.13.2.tgz", + "integrity": "sha512-MfxN6DMpvmdCbGlheJ+ihy11oTcipqDfcEIQV9ah3FGXBRCZtBOHJpQDk8qI2Y+nCXVr3Nln7OSsOzoC4+rSYQ==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-riscv64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.6.1.tgz", - "integrity": "sha512-ODJOJng6f3QxpAXhLel3kyWs8rPsJeo9XIZHzA7p//e+5kLMDU7bTVk4eZnUHuxsqsB8MEvPCicJkKCEuur5Ag==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.13.2.tgz", + "integrity": "sha512-WXrm4YiRU0ijqb72WHSjmfYaQZ7t6/kkQrFc4JtU+pUE4DZA/DEdxOuQEd4Q43VqmLvICTJWSaZMlCGQ4PSRUg==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-s390x-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.6.1.tgz", - "integrity": "sha512-hCzRiLhqe1ZOpHTsTGKp7gnMJRORlbCthawBueer2u22RVAka74pV/+4pP1tqM07mSlQn7VATuWaDw9gCl+cVg==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.13.2.tgz", + "integrity": "sha512-4pISWIlOFRUhWyvGCB3XUhtcwyvwGGhlXhHz7IXCXuGufaQtvR05trvw8U1ZnaPhsdPBkRhOMIedX11ayi5uXw==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-x64-gnu": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.6.1.tgz", - "integrity": "sha512-JansPD8ftOzMYIC3NfXJ68tt63LEcIAx44Blx6BAd7eY880KX7A0KN3hluCrelCz5aQkPaD95g8HBiJmKaEi2w==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.13.2.tgz", + "integrity": "sha512-DVo6jS8n73yNAmCsUOOk2vBeC60j2RauDXQM8p7RDl0afsEaA2le22vD8tky7iNoM5tsxfBmE4sOJXEKgpwWRw==", "dev": true, "optional": true }, "@oxc-resolver/binding-linux-x64-musl": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.6.1.tgz", - "integrity": "sha512-R78ES1rd4z2x5NrFPtSWb/ViR1B8wdl+QN2X8DdtoYcqZE/4tvWtn9ZTCXMEzUp23tchJ2wUB+p6hXoonkyLpA==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.13.2.tgz", + "integrity": "sha512-6WqrE+hQBFP35KdwQjWcZpldbTq6yJmuTVThISu+rY3+j6MaDp2ciLHTr1X68r2H/7ocOIl4k3NnOVIzeRJE3w==", "dev": true, "optional": true }, "@oxc-resolver/binding-wasm32-wasi": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.6.1.tgz", - "integrity": "sha512-qAR3tYIf3afkij/XYunZtlz3OH2Y4ni10etmCFIJB5VRGsqJyI6Hl+2dXHHGJNwbwjXjSEH/KWJBpVroF3TxBw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.13.2.tgz", + "integrity": "sha512-YpxvQmP2D+mNUkLQZbBjGz20g/pY8XoOBdPPoWMl9X68liFFjXxkPQTrZxWw4zzG/UkTM5z6dPRTyTePRsMcjw==", "dev": true, "optional": true, "requires": { - "@napi-rs/wasm-runtime": "^1.0.1" + "@napi-rs/wasm-runtime": "^1.0.7" } }, "@oxc-resolver/binding-win32-arm64-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.6.1.tgz", - "integrity": "sha512-QqygWygIuemGkaBA48POOTeinbVvlamqh6ucm8arGDGz/mB5O00gXWxed12/uVrYEjeqbMkla/CuL3fjL3EKvw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.13.2.tgz", + "integrity": "sha512-1SKBw6KcCmvPBdEw1/Qdpv6eSDf23lCXTWz9VxTe6QUQ/1wR+HZR2uS4q6C8W6jnIswMTQbxpTvVwdRXl+ufeA==", "dev": true, "optional": true }, "@oxc-resolver/binding-win32-ia32-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.6.1.tgz", - "integrity": "sha512-N2+kkWwt/bk0JTCxhPuK8t8JMp3nd0n2OhwOkU8KO4a7roAJEa4K1SZVjMv5CqUIr5sx2CxtXRBoFDiORX5oBg==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.13.2.tgz", + "integrity": "sha512-KEVV7wggDucxRn3vvyHnmTCPXoCT7vWpH18UVLTygibHJvNRP2zl5lBaQcCIdIaYYZjKt1aGI/yZqxZvHoiCdg==", "dev": true, "optional": true }, "@oxc-resolver/binding-win32-x64-msvc": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.6.1.tgz", - "integrity": "sha512-DfMg3cU9bJUbN62Prbp4fGCtLgexuwyEaQGtZAp8xmi1Ii26uflOGx0FJkFTF6lVMSFoIRFvIL8gsw5/ZdHrMw==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.13.2.tgz", + "integrity": "sha512-6AAdN9v/wO5c3td1yidgNLKYlzuNgfOtEqBq60WE469bJWR7gHgG/S5aLR2pH6/gyPLs9UXtItxi934D+0Estg==", "dev": true, "optional": true }, @@ -6111,9 +5995,9 @@ "optional": true }, "@tybys/wasm-util": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", - "integrity": "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", "dev": true, "optional": true, "requires": { @@ -6157,18 +6041,18 @@ "dev": true }, "@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true }, "@types/node": { - "version": "24.2.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.1.tgz", - "integrity": "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==", + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, "requires": { - "undici-types": "~7.10.0" + "undici-types": "~7.16.0" } }, "@types/source-map-support": { @@ -6187,16 +6071,16 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.1.tgz", - "integrity": "sha512-yYegZ5n3Yr6eOcqgj2nJH8cH/ZZgF+l0YIdKILSDjYFRjgYQMgv/lRjV5Z7Up04b9VYUondt8EPMqg7kTWgJ2g==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.47.0.tgz", + "integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/type-utils": "8.39.1", - "@typescript-eslint/utils": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/type-utils": "8.47.0", + "@typescript-eslint/utils": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -6212,38 +6096,38 @@ } }, "@typescript-eslint/parser": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.1.tgz", - "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.47.0.tgz", + "integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4" } }, "@typescript-eslint/project-service": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.39.1.tgz", - "integrity": "sha512-8fZxek3ONTwBu9ptw5nCKqZOSkXshZB7uAxuFF0J/wTMkKydjXCzqqga7MlFMpHi9DoG4BadhmTkITBcg8Aybw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.47.0.tgz", + "integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==", "dev": true, "requires": { - "@typescript-eslint/tsconfig-utils": "^8.39.1", - "@typescript-eslint/types": "^8.39.1", + "@typescript-eslint/tsconfig-utils": "^8.47.0", + "@typescript-eslint/types": "^8.47.0", "debug": "^4.3.4" } }, "@typescript-eslint/rule-tester": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.39.1.tgz", - "integrity": "sha512-I3iYy48LdtopHts4OpBb2qTysLPlv5JcqU61Zv6mtD6Zlo++oXpRb2WzIFjQRqUKHELo8VNnm1QdweN6TbTZ+A==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.47.0.tgz", + "integrity": "sha512-NpCv7bGe7+CY+DwwU7mhp3mTwpvELEyvbQxh8nKimCHdthEYHL993SHzPQNiJx17NePvQOmilE1ohjav3SdEdQ==", "dev": true, "requires": { - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/parser": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -6251,51 +6135,51 @@ } }, "@typescript-eslint/scope-manager": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.39.1.tgz", - "integrity": "sha512-RkBKGBrjgskFGWuyUGz/EtD8AF/GW49S21J8dvMzpJitOF1slLEbbHnNEtAHtnDAnx8qDEdRrULRnWVx27wGBw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.47.0.tgz", + "integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1" + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0" } }, "@typescript-eslint/tsconfig-utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.1.tgz", - "integrity": "sha512-ePUPGVtTMR8XMU2Hee8kD0Pu4NDE1CN9Q1sxGSGd/mbOtGZDM7pnhXNJnzW63zk/q+Z54zVzj44HtwXln5CvHA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.47.0.tgz", + "integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==", "dev": true, "requires": {} }, "@typescript-eslint/type-utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.39.1.tgz", - "integrity": "sha512-gu9/ahyatyAdQbKeHnhT4R+y3YLtqqHyvkfDxaBYk97EcbfChSJXyaJnIL3ygUv7OuZatePHmQvuH5ru0lnVeA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.47.0.tgz", + "integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==", "dev": true, "requires": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" } }, "@typescript-eslint/types": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.39.1.tgz", - "integrity": "sha512-7sPDKQQp+S11laqTrhHqeAbsCfMkwJMrV7oTDvtDds4mEofJYir414bYKUEb8YPUm9QL3U+8f6L6YExSoAGdQw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.47.0.tgz", + "integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.1.tgz", - "integrity": "sha512-EKkpcPuIux48dddVDXyQBlKdeTPMmALqBUbEk38McWv0qVEZwOpVJBi7ugK5qVNgeuYjGNQxrrnoM/5+TI/BPw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.47.0.tgz", + "integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==", "dev": true, "requires": { - "@typescript-eslint/project-service": "8.39.1", - "@typescript-eslint/tsconfig-utils": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/project-service": "8.47.0", + "@typescript-eslint/tsconfig-utils": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -6305,24 +6189,24 @@ } }, "@typescript-eslint/utils": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.39.1.tgz", - "integrity": "sha512-VF5tZ2XnUSTuiqZFXCZfZs1cgkdd3O/sSYmdo2EpSyDlC86UM/8YytTmKnehOW3TGAlivqTDT6bS87B/GQ/jyg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.47.0.tgz", + "integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1" + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0" } }, "@typescript-eslint/visitor-keys": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.1.tgz", - "integrity": "sha512-W8FQi6kEh2e8zVhQ0eeRnxdvIoOkAp/CPAahcNio6nO9dsIwb9b34z90KOlheoyuVf6LSOEdjlkxSkapNEc+4A==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.47.0.tgz", + "integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==", "dev": true, "requires": { - "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/types": "8.47.0", "eslint-visitor-keys": "^4.2.1" }, "dependencies": { @@ -6384,9 +6268,9 @@ "dev": true }, "ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true }, "ansi-styles": { @@ -6451,9 +6335,9 @@ "dev": true }, "before-after-hook": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", - "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz", + "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==", "dev": true }, "binary-extensions": { @@ -6728,9 +6612,9 @@ } }, "commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", "dev": true }, "comment-parser": { @@ -6780,9 +6664,9 @@ } }, "debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "requires": { "ms": "^2.1.3" @@ -6899,37 +6783,37 @@ } }, "esbuild": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", - "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", - "dev": true, - "requires": { - "@esbuild/aix-ppc64": "0.25.9", - "@esbuild/android-arm": "0.25.9", - "@esbuild/android-arm64": "0.25.9", - "@esbuild/android-x64": "0.25.9", - "@esbuild/darwin-arm64": "0.25.9", - "@esbuild/darwin-x64": "0.25.9", - "@esbuild/freebsd-arm64": "0.25.9", - "@esbuild/freebsd-x64": "0.25.9", - "@esbuild/linux-arm": "0.25.9", - "@esbuild/linux-arm64": "0.25.9", - "@esbuild/linux-ia32": "0.25.9", - "@esbuild/linux-loong64": "0.25.9", - "@esbuild/linux-mips64el": "0.25.9", - "@esbuild/linux-ppc64": "0.25.9", - "@esbuild/linux-riscv64": "0.25.9", - "@esbuild/linux-s390x": "0.25.9", - "@esbuild/linux-x64": "0.25.9", - "@esbuild/netbsd-arm64": "0.25.9", - "@esbuild/netbsd-x64": "0.25.9", - "@esbuild/openbsd-arm64": "0.25.9", - "@esbuild/openbsd-x64": "0.25.9", - "@esbuild/openharmony-arm64": "0.25.9", - "@esbuild/sunos-x64": "0.25.9", - "@esbuild/win32-arm64": "0.25.9", - "@esbuild/win32-ia32": "0.25.9", - "@esbuild/win32-x64": "0.25.9" + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", + "integrity": "sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.27.0", + "@esbuild/android-arm": "0.27.0", + "@esbuild/android-arm64": "0.27.0", + "@esbuild/android-x64": "0.27.0", + "@esbuild/darwin-arm64": "0.27.0", + "@esbuild/darwin-x64": "0.27.0", + "@esbuild/freebsd-arm64": "0.27.0", + "@esbuild/freebsd-x64": "0.27.0", + "@esbuild/linux-arm": "0.27.0", + "@esbuild/linux-arm64": "0.27.0", + "@esbuild/linux-ia32": "0.27.0", + "@esbuild/linux-loong64": "0.27.0", + "@esbuild/linux-mips64el": "0.27.0", + "@esbuild/linux-ppc64": "0.27.0", + "@esbuild/linux-riscv64": "0.27.0", + "@esbuild/linux-s390x": "0.27.0", + "@esbuild/linux-x64": "0.27.0", + "@esbuild/netbsd-arm64": "0.27.0", + "@esbuild/netbsd-x64": "0.27.0", + "@esbuild/openbsd-arm64": "0.27.0", + "@esbuild/openbsd-x64": "0.27.0", + "@esbuild/openharmony-arm64": "0.27.0", + "@esbuild/sunos-x64": "0.27.0", + "@esbuild/win32-arm64": "0.27.0", + "@esbuild/win32-ia32": "0.27.0", + "@esbuild/win32-x64": "0.27.0" } }, "escalade": { @@ -6945,24 +6829,23 @@ "dev": true }, "eslint": { - "version": "9.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.33.0.tgz", - "integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", + "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "requires": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.33.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.39.1", + "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -7105,9 +6988,9 @@ "dev": true }, "fast-content-type-parse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz", - "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", + "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==", "dev": true }, "fast-deep-equal": { @@ -7153,9 +7036,9 @@ "dev": true }, "fast-xml-parser": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", - "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.2.tgz", + "integrity": "sha512-n8v8b6p4Z1sMgqRmqLJm3awW4NX7NkaKPfb3uJIBTSH7Pdvufi3PQ3/lJLQrvxcMYl7JI2jnDO90siPEpD8JBA==", "dev": true, "requires": { "strnum": "^2.1.0" @@ -7246,9 +7129,9 @@ } }, "formatly": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.2.4.tgz", - "integrity": "sha512-lIN7GpcvX/l/i24r/L9bnJ0I8Qn01qijWpQpDDvTLL29nKqSaJJu4h20+7VJ6m2CAhQ2/En/GbxDiHCzq/0MyA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.3.0.tgz", + "integrity": "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==", "dev": true, "requires": { "fd-package-json": "^2.0.0" @@ -7314,9 +7197,9 @@ } }, "glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "requires": { "foreground-child": "^3.1.0", @@ -7337,9 +7220,9 @@ } }, "globals": { - "version": "16.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.3.0.tgz", - "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==", + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", "dev": true }, "gopd": { @@ -7382,9 +7265,9 @@ "dev": true }, "hereby": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/hereby/-/hereby-1.11.0.tgz", - "integrity": "sha512-Tdp03ueQL3w5eZCrQVW4POBDxg9ldjNyFrZYWt6ndMha5agyRUO8b+irOEG3B1RSS9/2LxSjjyG6DSxITouJzA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/hereby/-/hereby-1.11.1.tgz", + "integrity": "sha512-3tcp92aUN6mSmWslo/EIoz3AAKa9GPmiJ3g0ZgXC8NGZPyh4J3T+JoGfD4JTiL31SW+pFliKKHu1uxa7nwDv0g==", "dev": true, "requires": { "command-line-usage": "^6.1.3", @@ -7516,9 +7399,9 @@ } }, "istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -7536,9 +7419,9 @@ } }, "jiti": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", - "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true }, "js-md4": { @@ -7548,18 +7431,18 @@ "dev": true }, "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, "jsdoc-type-pratt-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", - "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.8.0.tgz", + "integrity": "sha512-iZ8Bdb84lWRuGHamRXFyML07r21pcwBrLkHEuHgEY5UbCouBwv7ECknDRKzsQIXMiqpPymqtIf8TC/shYKB5rw==", "dev": true }, "json-buffer": { @@ -7596,30 +7479,29 @@ } }, "knip": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/knip/-/knip-5.62.0.tgz", - "integrity": "sha512-hfTUVzmrMNMT1khlZfAYmBABeehwWUUrizLQoLamoRhSFkygsGIXWx31kaWKBgEaIVL77T3Uz7IxGvSw+CvQ6A==", + "version": "5.70.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.70.0.tgz", + "integrity": "sha512-ZRO7GzegusadOqR0ICxEQfbM1RS+1Uu/LtATpzO71pHXZQnoj4K47/QtuCtfvJVjWb2R4a7YwHv+Ey9xoxjQCw==", "dev": true, "requires": { "@nodelib/fs.walk": "^1.2.3", "fast-glob": "^3.3.3", - "formatly": "^0.2.4", - "jiti": "^2.4.2", - "js-yaml": "^4.1.0", + "formatly": "^0.3.0", + "jiti": "^2.6.0", + "js-yaml": "^4.1.1", "minimist": "^1.2.8", - "oxc-resolver": "^11.1.0", + "oxc-resolver": "^11.13.2", "picocolors": "^1.1.1", "picomatch": "^4.0.1", - "smol-toml": "^1.3.4", - "strip-json-comments": "5.0.2", - "zod": "^3.22.4", - "zod-validation-error": "^3.0.3" + "smol-toml": "^1.5.2", + "strip-json-comments": "5.0.3", + "zod": "^4.1.11" }, "dependencies": { "strip-json-comments": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.2.tgz", - "integrity": "sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", "dev": true } } @@ -7935,21 +7817,21 @@ "dev": true }, "monocart-coverage-reports": { - "version": "2.12.6", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.6.tgz", - "integrity": "sha512-96CMC4B+Rw5Yi8OH2Aot+aMYIw84fK3PNJs7nP9Yw07I0+k0lY1GGiPOJTt123GMDdSpS32lPUIMu/OyqOfBCA==", + "version": "2.12.9", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.9.tgz", + "integrity": "sha512-vtFqbC3Egl4nVa1FSIrQvMPO6HZtb9lo+3IW7/crdvrLNW2IH8lUsxaK0TsKNmMO2mhFWwqQywLV2CZelqPgwA==", "dev": true, "requires": { - "acorn": "^8.14.1", - "acorn-loose": "^8.5.0", + "acorn": "^8.15.0", + "acorn-loose": "^8.5.2", "acorn-walk": "^8.3.4", - "commander": "^13.1.0", + "commander": "^14.0.0", "console-grid": "^2.2.3", "eight-colors": "^1.3.1", "foreground-child": "^3.3.1", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.7", + "istanbul-reports": "^3.2.0", "lz-utils": "^2.1.0", "monocart-locator": "^1.0.2" } @@ -7966,12 +7848,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "napi-postinstall": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.3.tgz", - "integrity": "sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow==", - "dev": true - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8014,31 +7890,30 @@ } }, "oxc-resolver": { - "version": "11.6.1", - "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.6.1.tgz", - "integrity": "sha512-WQgmxevT4cM5MZ9ioQnEwJiHpPzbvntV5nInGAKo9NQZzegcOonHvcVcnkYqld7bTG35UFHEKeF7VwwsmA3cZg==", - "dev": true, - "requires": { - "@oxc-resolver/binding-android-arm-eabi": "11.6.1", - "@oxc-resolver/binding-android-arm64": "11.6.1", - "@oxc-resolver/binding-darwin-arm64": "11.6.1", - "@oxc-resolver/binding-darwin-x64": "11.6.1", - "@oxc-resolver/binding-freebsd-x64": "11.6.1", - "@oxc-resolver/binding-linux-arm-gnueabihf": "11.6.1", - "@oxc-resolver/binding-linux-arm-musleabihf": "11.6.1", - "@oxc-resolver/binding-linux-arm64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-arm64-musl": "11.6.1", - "@oxc-resolver/binding-linux-ppc64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-riscv64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-riscv64-musl": "11.6.1", - "@oxc-resolver/binding-linux-s390x-gnu": "11.6.1", - "@oxc-resolver/binding-linux-x64-gnu": "11.6.1", - "@oxc-resolver/binding-linux-x64-musl": "11.6.1", - "@oxc-resolver/binding-wasm32-wasi": "11.6.1", - "@oxc-resolver/binding-win32-arm64-msvc": "11.6.1", - "@oxc-resolver/binding-win32-ia32-msvc": "11.6.1", - "@oxc-resolver/binding-win32-x64-msvc": "11.6.1", - "napi-postinstall": "^0.3.0" + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.13.2.tgz", + "integrity": "sha512-1SXVyYQ9bqMX3uZo8Px81EG7jhZkO9PvvR5X9roY5TLYVm4ZA7pbPDNlYaDBBeF9U+YO3OeMNoHde52hrcCu8w==", + "dev": true, + "requires": { + "@oxc-resolver/binding-android-arm-eabi": "11.13.2", + "@oxc-resolver/binding-android-arm64": "11.13.2", + "@oxc-resolver/binding-darwin-arm64": "11.13.2", + "@oxc-resolver/binding-darwin-x64": "11.13.2", + "@oxc-resolver/binding-freebsd-x64": "11.13.2", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.13.2", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.13.2", + "@oxc-resolver/binding-linux-arm64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-arm64-musl": "11.13.2", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-riscv64-musl": "11.13.2", + "@oxc-resolver/binding-linux-s390x-gnu": "11.13.2", + "@oxc-resolver/binding-linux-x64-gnu": "11.13.2", + "@oxc-resolver/binding-linux-x64-musl": "11.13.2", + "@oxc-resolver/binding-wasm32-wasi": "11.13.2", + "@oxc-resolver/binding-win32-arm64-msvc": "11.13.2", + "@oxc-resolver/binding-win32-ia32-msvc": "11.13.2", + "@oxc-resolver/binding-win32-x64-msvc": "11.13.2" } }, "p-limit": { @@ -8121,19 +7996,19 @@ "dev": true }, "playwright": { - "version": "1.54.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.2.tgz", - "integrity": "sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", + "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.54.2" + "playwright-core": "1.56.1" } }, "playwright-core": { - "version": "1.54.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.2.tgz", - "integrity": "sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", + "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", "dev": true }, "plur": { @@ -8266,9 +8141,9 @@ } }, "semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true }, "serialize-javascript": { @@ -8350,9 +8225,9 @@ "dev": true }, "smol-toml": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", - "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.5.2.tgz", + "integrity": "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==", "dev": true }, "source-map": { @@ -8417,9 +8292,9 @@ } }, "strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, "requires": { "ansi-regex": "^6.0.1" @@ -8543,21 +8418,21 @@ } }, "typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true }, "typescript-eslint": { - "version": "8.39.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.39.1.tgz", - "integrity": "sha512-GDUv6/NDYngUlNvwaHM1RamYftxf782IyEDbdj3SeaIHHv8fNQVRC++fITT7kUJV/5rIA/tkoRSSskt6osEfqg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.47.0.tgz", + "integrity": "sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "8.39.1", - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1" + "@typescript-eslint/eslint-plugin": "8.47.0", + "@typescript-eslint/parser": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0" } }, "typical": { @@ -8573,9 +8448,9 @@ "dev": true }, "undici-types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", - "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "dev": true }, "universal-user-agent": { @@ -8653,9 +8528,9 @@ }, "dependencies": { "ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true } } @@ -8791,17 +8666,10 @@ "dev": true }, "zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz", + "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "dev": true - }, - "zod-validation-error": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.5.3.tgz", - "integrity": "sha512-OT5Y8lbUadqVZCsnyFaTQ4/O2mys4tj7PqhdbBCp7McPwvIEKfPtdA6QfPeFQK2/Rz5LgwmAXRJTugBNBi0btw==", - "dev": true, - "requires": {} } } } diff --git a/package.json b/package.json index ad629ace064c5..0b1a5c98ce063 100644 --- a/package.json +++ b/package.json @@ -42,45 +42,45 @@ "@dprint/formatter": "^0.4.1", "@dprint/typescript": "0.93.4", "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.33.0", - "@octokit/rest": "^21.1.1", + "@eslint/js": "^9.39.1", + "@octokit/rest": "^22.0.1", "@types/chai": "^4.3.20", "@types/minimist": "^1.2.5", "@types/mocha": "^10.0.10", - "@types/ms": "^0.7.34", + "@types/ms": "^2.1.0", "@types/node": "latest", "@types/source-map-support": "^0.5.10", "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.39.1", - "@typescript-eslint/type-utils": "^8.39.1", - "@typescript-eslint/utils": "^8.39.1", + "@typescript-eslint/rule-tester": "^8.47.0", + "@typescript-eslint/type-utils": "^8.47.0", + "@typescript-eslint/utils": "^8.47.0", "azure-devops-node-api": "^15.1.1", "c8": "^10.1.3", "chai": "^4.5.0", "chokidar": "^4.0.3", "diff": "^8.0.2", "dprint": "^0.49.1", - "esbuild": "^0.25.9", - "eslint": "^9.33.0", + "esbuild": "^0.27.0", + "eslint": "^9.39.1", "eslint-formatter-autolinkable-stylish": "^1.4.0", "eslint-plugin-regexp": "^2.10.0", - "fast-xml-parser": "^5.2.5", - "glob": "^10.4.5", - "globals": "^16.3.0", - "hereby": "^1.11.0", + "fast-xml-parser": "^5.3.2", + "glob": "^10.5.0", + "globals": "^16.5.0", + "hereby": "^1.11.1", "jsonc-parser": "^3.3.1", - "knip": "^5.62.0", + "knip": "^5.70.0", "minimist": "^1.2.8", "mocha": "^10.8.2", "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.12.6", + "monocart-coverage-reports": "^2.12.9", "ms": "^2.1.3", "picocolors": "^1.1.1", - "playwright": "^1.54.2", + "playwright": "^1.56.1", "source-map-support": "^0.5.21", "tslib": "^2.8.1", - "typescript": "^5.9.2", - "typescript-eslint": "^8.39.1", + "typescript": "^5.9.3", + "typescript-eslint": "^8.47.0", "which": "^3.0.1" }, "overrides": { diff --git a/scripts/CopyrightNotice.txt b/scripts/CopyrightNotice.txt index fee4889c83ff9..5e2c1635f6924 100644 --- a/scripts/CopyrightNotice.txt +++ b/scripts/CopyrightNotice.txt @@ -7,7 +7,7 @@ License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +MERCHANTABILITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index cfa409e878c82..b01352968eb42 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1000,6 +1000,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { const saveExceptionTarget = currentExceptionTarget; const saveActiveLabelList = activeLabelList; const saveHasExplicitReturn = hasExplicitReturn; + const saveSeenThisKeyword = seenThisKeyword; const isImmediatelyInvoked = ( containerFlags & ContainerFlags.IsFunctionExpression && !hasSyntacticModifier(node, ModifierFlags.Async) && @@ -1022,19 +1023,22 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { currentContinueTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; + seenThisKeyword = false; bindChildren(node); - // Reset all reachability check related flags on node (for incremental scenarios) - node.flags &= ~NodeFlags.ReachabilityAndEmitFlags; + // Reset flags (for incremental scenarios) + node.flags &= ~(NodeFlags.ReachabilityAndEmitFlags | NodeFlags.ContainsThis); if (!(currentFlow.flags & FlowFlags.Unreachable) && containerFlags & ContainerFlags.IsFunctionLike && nodeIsPresent((node as FunctionLikeDeclaration | ClassStaticBlockDeclaration).body)) { node.flags |= NodeFlags.HasImplicitReturn; if (hasExplicitReturn) node.flags |= NodeFlags.HasExplicitReturn; (node as FunctionLikeDeclaration | ClassStaticBlockDeclaration).endFlowNode = currentFlow; } + if (seenThisKeyword) { + node.flags |= NodeFlags.ContainsThis; + } if (node.kind === SyntaxKind.SourceFile) { node.flags |= emitFlags; (node as SourceFile).endFlowNode = currentFlow; } - if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); @@ -1051,12 +1055,15 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { currentExceptionTarget = saveExceptionTarget; activeLabelList = saveActiveLabelList; hasExplicitReturn = saveHasExplicitReturn; + seenThisKeyword = node.kind === SyntaxKind.ArrowFunction ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword; } else if (containerFlags & ContainerFlags.IsInterface) { + const saveSeenThisKeyword = seenThisKeyword; seenThisKeyword = false; bindChildren(node); Debug.assertNotNode(node, isIdentifier); // ContainsThis cannot overlap with HasExtendedUnicodeEscape on Identifier node.flags = seenThisKeyword ? node.flags | NodeFlags.ContainsThis : node.flags & ~NodeFlags.ContainsThis; + seenThisKeyword = saveSeenThisKeyword; } else { bindChildren(node); @@ -1091,6 +1098,11 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { // and set it before we descend into nodes that could actually be part of an assignment pattern. inAssignmentPattern = false; + // Clear Unreachable flag from previous binding (for incremental scenarios) + if (isPotentiallyExecutableNode(node)) { + (node as Mutable).flags &= ~NodeFlags.Unreachable; + } + if (currentFlow === unreachableFlow) { if (canHaveFlowNode(node)) { node.flowNode = undefined; @@ -2847,6 +2859,9 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { } // falls through case SyntaxKind.ThisKeyword: + if (node.kind === SyntaxKind.ThisKeyword) { + seenThisKeyword = true; + } // TODO: Why use `isExpression` here? both Identifier and ThisKeyword are expressions. if (currentFlow && (isExpression(node) || parent.kind === SyntaxKind.ShorthandPropertyAssignment)) { (node as Identifier | ThisExpression).flowNode = currentFlow; @@ -3828,6 +3843,8 @@ export function getContainerFlags(node: Node): ContainerFlags { // falls through case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ClassStaticBlockDeclaration: + return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike; case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: case SyntaxKind.JSDocSignature: @@ -3835,12 +3852,11 @@ export function getContainerFlags(node: Node): ContainerFlags { case SyntaxKind.FunctionType: case SyntaxKind.ConstructSignature: case SyntaxKind.ConstructorType: - case SyntaxKind.ClassStaticBlockDeclaration: - return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike; + return ContainerFlags.IsContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike; case SyntaxKind.JSDocImportTag: // treat as a container to prevent using an enclosing effective host, ensuring import bindings are scoped correctly - return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals; + return ContainerFlags.IsContainer | ContainerFlags.HasLocals; case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: @@ -3848,8 +3864,6 @@ export function getContainerFlags(node: Node): ContainerFlags { case SyntaxKind.ModuleBlock: return ContainerFlags.IsControlFlowContainer; - case SyntaxKind.PropertyDeclaration: - return (node as PropertyDeclaration).initializer ? ContainerFlags.IsControlFlowContainer : 0; case SyntaxKind.CatchClause: case SyntaxKind.ForStatement: diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ba5765c0826a3..51c9493b61721 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -347,7 +347,6 @@ import { getNamespaceDeclarationNode, getNewTargetContainer, getNonAugmentationDeclaration, - getNonModifierTokenPosOfNode, getNormalizedAbsolutePath, getObjectFlags, getOriginalNode, @@ -384,6 +383,7 @@ import { getTextOfPropertyName, getThisContainer, getThisParameter, + getTokenPosOfNode, getTrailingSemicolonDeferringWriter, getTypeParameterFromJsDoc, getUseDefineForClassFields, @@ -504,6 +504,7 @@ import { isCallLikeOrFunctionLikeExpression, isCallOrNewExpression, isCallSignatureDeclaration, + isCaseOrDefaultClause, isCatchClause, isCatchClauseVariableDeclaration, isCatchClauseVariableDeclarationOrBindingElement, @@ -1747,7 +1748,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!node) { return undefined; } - if (contextFlags! & ContextFlags.Completions) { + if (contextFlags! & ContextFlags.IgnoreNodeInferences) { return runWithInferenceBlockedFromSourceNode(node, () => getContextualType(node, contextFlags)); } return getContextualType(node, contextFlags); @@ -2188,7 +2189,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { }; var anyIterationTypes = createIterationTypes(anyType, anyType, anyType); - var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType); var asyncIterationTypesResolver: IterationTypesResolver = { iterableCacheKey: "iterationTypesOfAsyncIterable", @@ -2839,7 +2839,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // When merging the module augmentation into a.ts, the symbol for `A` will itself be merged, so its parent // should be the merged module symbol. But the symbol for `B` has only one declaration, so its parent should // be the module augmentation symbol, which contains its only declaration. - merged.parent = mergedParent; + if (merged.flags & SymbolFlags.Transient) { + merged.parent = mergedParent; + } } target.set(id, merged); }); @@ -21141,9 +21143,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const { initializer } = node as JsxAttribute; return !!initializer && isContextSensitive(initializer); } - case SyntaxKind.JsxExpression: { + case SyntaxKind.JsxExpression: + case SyntaxKind.YieldExpression: { // It is possible to that node.expression is undefined (e.g
) - const { expression } = node as JsxExpression; + const { expression } = node as JsxExpression | YieldExpression; return !!expression && isContextSensitive(expression); } } @@ -21152,7 +21155,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function isContextSensitiveFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean { - return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node); + return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || hasContextSensitiveYieldExpression(node); } function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) { @@ -21165,6 +21168,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return !!forEachReturnStatement(node.body as Block, statement => !!statement.expression && isContextSensitive(statement.expression)); } + function hasContextSensitiveYieldExpression(node: FunctionLikeDeclaration): boolean { + // yield expressions can be context sensitive in situations like: + // + // declare function test(gen: () => Generator<(arg: number) => string, void, void>): void; + // + // test(function* () { + // yield (arg) => String(arg); + // }); + return !!(getFunctionFlags(node) & FunctionFlags.Generator && node.body && forEachYieldExpression(node.body as Block, isContextSensitive)); + } + function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration { return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -26435,7 +26449,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const templateType = getTemplateTypeFromMappedType(target); const inference = createInferenceInfo(typeParameter); inferTypes([inference], sourceType, templateType); - return getTypeFromInference(inference) || unknownType; + return getWidenedType(getTypeFromInference(inference) || unknownType); } function inferReverseMappedType(source: Type, target: MappedType, constraint: IndexType): Type | undefined { @@ -27575,10 +27589,20 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const constraint = getConstraintOfTypeParameter(inference.typeParameter); if (constraint) { const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper); - if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (inferredType) { + const constraintWithThis = getTypeWithThisArgument(instantiatedConstraint, inferredType); + if (!context.compareTypes(inferredType, constraintWithThis)) { + // If we have a pure return type inference, we may succeed by removing constituents of the inferred type + // that aren't assignable to the constraint type (pure return type inferences are speculation anyway). + const filteredByConstraint = inference.priority === InferencePriority.ReturnType ? filterType(inferredType, t => !!context.compareTypes(t, constraintWithThis)) : neverType; + inferredType = !(filteredByConstraint.flags & TypeFlags.Never) ? filteredByConstraint : undefined; + } + } + if (!inferredType) { // If the fallback type satisfies the constraint, we pick it. Otherwise, we pick the constraint. - inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; + inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; } + inference.inferredType = inferredType; } clearActiveMapperCaches(); } @@ -32617,7 +32641,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (inferenceContext && contextFlags! & ContextFlags.Signature && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) { // For contextual signatures we incorporate all inferences made so far, e.g. from return // types as well as arguments to the left in a function call. - return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); + const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); + if (!(type.flags & TypeFlags.AnyOrUnknown)) { + return type; + } } if (inferenceContext?.returnMapper) { // For other purposes (e.g. determining whether to produce literal types) we only @@ -32625,9 +32652,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // the 'boolean' type from the contextual type such that contextually typed boolean // literals actually end up widening to 'boolean' (see #48363). const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); - return type.flags & TypeFlags.Union && containsType((type as UnionType).types, regularFalseType) && containsType((type as UnionType).types, regularTrueType) ? - filterType(type, t => t !== regularFalseType && t !== regularTrueType) : - type; + if (!(type.flags & TypeFlags.AnyOrUnknown)) { + return type.flags & TypeFlags.Union && containsType((type as UnionType).types, regularFalseType) && containsType((type as UnionType).types, regularTrueType) ? + filterType(type, t => t !== regularFalseType && t !== regularTrueType) : + type; + } } } return contextualType; @@ -32694,7 +32723,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return getContextualTypeForAwaitOperand(parent as AwaitExpression, contextFlags); case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: - return getContextualTypeForArgument(parent as CallExpression | NewExpression | Decorator, node); + return getContextualTypeForArgument(parent as CallExpression | NewExpression, node); case SyntaxKind.Decorator: return getContextualTypeForDecorator(parent as Decorator); case SyntaxKind.TypeAssertionExpression: @@ -32833,7 +32862,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function getContextualJsxElementAttributesType(node: JsxOpeningLikeElement, contextFlags: ContextFlags | undefined) { - if (isJsxOpeningElement(node) && contextFlags !== ContextFlags.Completions) { + if (isJsxOpeningElement(node) && contextFlags !== ContextFlags.IgnoreNodeInferences) { const index = findContextualNode(node.parent, /*includeCaches*/ !contextFlags); if (index >= 0) { // Contextually applied type is moved from attributes up to the outer jsx attributes so when walking up from the children they get hit @@ -39217,7 +39246,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const nextTypes: Type[] = []; const isAsync = (getFunctionFlags(func) & FunctionFlags.Async) !== 0; forEachYieldExpression(func.body as Block, yieldExpression => { - let yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType; + let yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode && checkMode & ~CheckMode.SkipGenericFunctions) : undefinedWideningType; if (yieldExpression.expression && isConstContext(yieldExpression.expression)) { yieldExpressionType = getRegularTypeOfLiteralType(yieldExpressionType); } @@ -39240,9 +39269,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function getYieldedTypeOfYieldExpression(node: YieldExpression, expressionType: Type, sentType: Type, isAsync: boolean): Type | undefined { - if (expressionType === silentNeverType) { - return silentNeverType; - } const errorNode = node.expression || node; // A `yield*` expression effectively yields everything that its operand yields const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? IterationUse.AsyncYieldStar : IterationUse.YieldStar, expressionType, sentType, errorNode) : expressionType; @@ -45846,9 +45872,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { */ function getIterationTypesOfIterable(type: Type, use: IterationUse, errorNode: Node | undefined) { type = getReducedType(type); - if (type === silentNeverType) { - return silentNeverIterationTypes; - } if (isTypeAny(type)) { return anyIterationTypes; } @@ -48098,12 +48121,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (isIdentifier(node.name)) { checkCollisionsForDeclarationName(node, node.name); if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) { - const sourceFile = getSourceFileOfNode(node); - const pos = getNonModifierTokenPosOfNode(node); - const span = getSpanOfTokenAtPosition(sourceFile, pos); - suggestionDiagnostics.add( - createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead), - ); + error(node.name, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead); } } @@ -49215,8 +49233,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const sourceFile = getSourceFileOfNode(node); - let start = node.pos; - let end = node.end; + let startNode = node; + let endNode = node; const parent = node.parent; if (canHaveStatements(parent)) { @@ -49246,13 +49264,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { reportedUnreachableNodes.add(nextNode); } - start = statements[first].pos; - end = statements[last].end; + startNode = statements[first]; + endNode = statements[last]; } } - start = skipTrivia(sourceFile.text, start); - addErrorOrSuggestion(compilerOptions.allowUnreachableCode === false, createFileDiagnostic(sourceFile, start, end - start, Diagnostics.Unreachable_code_detected)); + const start = getTokenPosOfNode(startNode, sourceFile); + addErrorOrSuggestion(compilerOptions.allowUnreachableCode === false, createFileDiagnostic(sourceFile, start, endNode.end - start, Diagnostics.Unreachable_code_detected)); return true; } @@ -53175,6 +53193,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration, ); } + else if (isVariableStatement(declarationList.parent) && isCaseOrDefaultClause(declarationList.parent.parent)) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === NodeFlags.Using ? + Diagnostics.using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block : + Diagnostics.await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block, + ); + } if (declarationList.flags & NodeFlags.Ambient) { return grammarErrorOnNode( diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4c0ffb2ad57e5..236e643b00b3c 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -674,6 +674,15 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing, defaultValueDescription: false, }, + { + name: "ignoreConfig", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: Diagnostics.Ignore_the_tsconfig_found_and_build_with_commandline_options_and_files, + defaultValueDescription: false, + }, // Basic targetOptionDeclaration, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 75da7fcff9347..03f5f19a69877 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1821,9 +1821,8 @@ "code": 1539 }, "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": { - "category": "Suggestion", - "code": 1540, - "reportsDeprecated": true + "category": "Error", + "code": 1540 }, "Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute.": { "category": "Error", @@ -1849,6 +1848,18 @@ "category": "Error", "code": 1546 }, + "'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.": { + "category": "Error", + "code": 1547 + }, + "'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.": { + "category": "Error", + "code": 1548 + }, + "Ignore the tsconfig found and build with commandline options and files.": { + "category": "Message", + "code": 1549 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", @@ -4725,6 +4736,10 @@ "category": "Message", "code": 5111 }, + "tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.": { + "category": "Error", + "code": 5112 + }, "Generates a sourcemap for each corresponding '.d.ts' file.": { "category": "Message", diff --git a/src/compiler/executeCommandLine.ts b/src/compiler/executeCommandLine.ts index edeb0eb277c57..6b6fb23683ca2 100644 --- a/src/compiler/executeCommandLine.ts +++ b/src/compiler/executeCommandLine.ts @@ -614,20 +614,27 @@ function executeCommandLineWorker( } } } - else if (commandLine.fileNames.length === 0) { + else if (!commandLine.options.ignoreConfig || commandLine.fileNames.length === 0) { const searchPath = normalizePath(sys.getCurrentDirectory()); configFileName = findConfigFile(searchPath, fileName => sys.fileExists(fileName)); - } - - if (commandLine.fileNames.length === 0 && !configFileName) { - if (commandLine.options.showConfig) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath(sys.getCurrentDirectory()))); + // if (!commandLine.options.ignoreConfig) { + if (commandLine.fileNames.length !== 0) { + if (configFileName) { + // Error to not specify config file + reportDiagnostic(createCompilerDiagnostic(Diagnostics.tsconfig_json_is_present_but_will_not_be_loaded_if_files_are_specified_on_commandline_Use_ignoreConfig_to_skip_this_error)); + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + } } - else { - printVersion(sys); - printHelp(sys, commandLine); + else if (!configFileName) { + if (commandLine.options.showConfig) { + reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath(sys.getCurrentDirectory()))); + } + else { + printVersion(sys); + printHelp(sys, commandLine); + } + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } - return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } const currentDirectory = sys.getCurrentDirectory(); diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 1c5f22e25bd9c..2bf692f6298a6 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1690,13 +1690,16 @@ export enum NodeResolutionFeatures { // allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"` // not supported in node 12 - https://github.com/nodejs/Release/issues/690 ExportsPatternTrailers = 1 << 4, - AllFeatures = Imports | SelfName | Exports | ExportsPatternTrailers, + // allowing `#/` root imports in package.json imports field + // not supported until mass adoption - https://github.com/nodejs/node/pull/60864 + ImportsPatternRoot = 1 << 6, + AllFeatures = Imports | SelfName | Exports | ExportsPatternTrailers | ImportsPatternRoot, Node16Default = Imports | SelfName | Exports | ExportsPatternTrailers, NodeNextDefault = AllFeatures, - BundlerDefault = Imports | SelfName | Exports | ExportsPatternTrailers, + BundlerDefault = Imports | SelfName | Exports | ExportsPatternTrailers | ImportsPatternRoot, EsmMode = 1 << 5, } @@ -2646,7 +2649,7 @@ function loadModuleFromExports(scope: PackageJsonInfo, extensions: Extensions, s } function loadModuleFromImports(extensions: Extensions, moduleName: string, directory: string, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined): SearchResult { - if (moduleName === "#" || startsWith(moduleName, "#/")) { + if (moduleName === "#" || (startsWith(moduleName, "#/") && !(state.features & NodeResolutionFeatures.ImportsPatternRoot))) { if (state.traceEnabled) { trace(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName); } diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index eace2e2c28057..2395035dcc156 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -6,7 +6,6 @@ import { BindingElement, Block, Bundle, - CaseOrDefaultClause, chainBundle, ClassDeclaration, Debug, @@ -25,7 +24,6 @@ import { isArray, isBindingPattern, isBlock, - isCaseClause, isCustomPrologue, isExpression, isGeneratedIdentifier, @@ -49,7 +47,6 @@ import { skipOuterExpressions, SourceFile, Statement, - SwitchStatement, SyntaxKind, TransformationContext, TransformFlags, @@ -123,9 +120,6 @@ export function transformESNext(context: TransformationContext): (x: SourceFile case SyntaxKind.ForOfStatement: return visitForOfStatement(node as ForOfStatement); - case SyntaxKind.SwitchStatement: - return visitSwitchStatement(node as SwitchStatement); - default: return visitEachChild(node, visitor, context); } @@ -339,72 +333,6 @@ export function transformESNext(context: TransformationContext): (x: SourceFile return visitEachChild(node, visitor, context); } - function visitCaseOrDefaultClause(node: CaseOrDefaultClause, envBinding: Identifier) { - if (getUsingKindOfStatements(node.statements) !== UsingKind.None) { - if (isCaseClause(node)) { - return factory.updateCaseClause( - node, - visitNode(node.expression, visitor, isExpression), - transformUsingDeclarations(node.statements, /*start*/ 0, node.statements.length, envBinding, /*topLevelStatements*/ undefined), - ); - } - else { - return factory.updateDefaultClause( - node, - transformUsingDeclarations(node.statements, /*start*/ 0, node.statements.length, envBinding, /*topLevelStatements*/ undefined), - ); - } - } - return visitEachChild(node, visitor, context); - } - - function visitSwitchStatement(node: SwitchStatement) { - // given: - // - // switch (expr) { - // case expr: - // using res = expr; - // } - // - // produces: - // - // const env_1 = { stack: [], error: void 0, hasError: false }; - // try { - // switch(expr) { - // case expr: - // const res = __addDisposableResource(env_1, expr, false); - // } - // } - // catch (e_1) { - // env_1.error = e_1; - // env_1.hasError = true; - // } - // finally { - // __disposeResources(env_1); - // } - // - const usingKind = getUsingKindOfCaseOrDefaultClauses(node.caseBlock.clauses); - if (usingKind) { - const envBinding = createEnvBinding(); - return createDownlevelUsingStatements( - [ - factory.updateSwitchStatement( - node, - visitNode(node.expression, visitor, isExpression), - factory.updateCaseBlock( - node.caseBlock, - node.caseBlock.clauses.map(clause => visitCaseOrDefaultClause(clause, envBinding)), - ), - ), - ], - envBinding, - usingKind === UsingKind.Async, - ); - } - - return visitEachChild(node, visitor, context); - } - /** * Transform `using` declarations in a statement list. */ @@ -870,13 +798,3 @@ function getUsingKindOfStatements(statements: readonly Statement[]): UsingKind { } return result; } - -function getUsingKindOfCaseOrDefaultClauses(clauses: readonly CaseOrDefaultClause[]): UsingKind { - let result = UsingKind.None; - for (const clause of clauses) { - const usingKind = getUsingKindOfStatements(clause.statements); - if (usingKind === UsingKind.Async) return UsingKind.Async; - if (usingKind > result) result = usingKind; - } - return result; -} diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 617ec4d8bda75..ef01015982139 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5515,11 +5515,11 @@ export const enum IntersectionFlags { // dprint-ignore /** @internal */ export const enum ContextFlags { - None = 0, - Signature = 1 << 0, // Obtaining contextual signature - NoConstraints = 1 << 1, // Don't obtain type variable constraints - Completions = 1 << 2, // Ignore inference to current node and parent nodes out to the containing call for completions - SkipBindingPatterns = 1 << 3, // Ignore contextual types applied by binding patterns + None = 0, + Signature = 1 << 0, // Obtaining contextual signature + NoConstraints = 1 << 1, // Don't obtain type variable constraints + IgnoreNodeInferences = 1 << 2, // Ignore inference to current node and parent nodes out to the containing call for, for example, completions + SkipBindingPatterns = 1 << 3, // Ignore contextual types applied by binding patterns } // NOTE: If modifying this enum, must modify `TypeFormatFlags` too! @@ -6526,7 +6526,7 @@ export const enum ObjectFlags { /** @internal */ ContainsObjectOrArrayLiteral = 1 << 17, // Type is or contains object literal type /** @internal */ - NonInferrableType = 1 << 18, // Type is or contains anyFunctionType or silentNeverType + NonInferrableType = 1 << 18, // Type is or contains anyFunctionType or silentNeverType, or it's a context free `returnTypeOnly` /** @internal */ CouldContainTypeVariablesComputed = 1 << 19, // CouldContainTypeVariables flag has been computed /** @internal */ @@ -7552,6 +7552,7 @@ export interface CompilerOptions { /** @internal */ watch?: boolean; esModuleInterop?: boolean; /** @internal */ showConfig?: boolean; + /** @internal */ ignoreConfig?: boolean; useDefineForClassFields?: boolean; /** @internal */ tscBuild?: boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index cdf898ca8c3fc..ba6b6d253a31c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1282,16 +1282,6 @@ export function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFil return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end); } -/** @internal */ -export function getNonModifierTokenPosOfNode(node: Node, sourceFile?: SourceFileLike): number { - const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : undefined; - if (!lastModifier) { - return getTokenPosOfNode(node, sourceFile); - } - - return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end); -} - /** @internal */ export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node, includeTrivia = false): string { return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); @@ -2880,19 +2870,24 @@ export function forEachReturnStatement(body: Block | Statement, visitor: (stm } } +// Warning: This has the same semantics as the forEach family of functions, +// in that traversal terminates in the event that 'visitor' supplies a truthy value. /** @internal */ -export function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => void): void { +export function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => T): T | undefined { return traverse(body); - function traverse(node: Node): void { + function traverse(node: Node): T | undefined { switch (node.kind) { case SyntaxKind.YieldExpression: - visitor(node as YieldExpression); + const value = visitor(node as YieldExpression); + if (value) { + return value; + } const operand = (node as YieldExpression).expression; - if (operand) { - traverse(operand); + if (!operand) { + return; } - return; + return traverse(operand); case SyntaxKind.EnumDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.ModuleDeclaration: @@ -2905,14 +2900,13 @@ export function forEachYieldExpression(body: Block, visitor: (expr: YieldExpress if (node.name && node.name.kind === SyntaxKind.ComputedPropertyName) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(node.name.expression); - return; + return traverse(node.name.expression); } } else if (!isPartOfTypeNode(node)) { // This is the general case, which should include mostly expressions and statements. // Also includes NodeArrays. - forEachChild(node, traverse); + return forEachChild(node, traverse); } } } @@ -4792,7 +4786,7 @@ export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { par return typeParameters && find(typeParameters, p => p.name.escapedText === name); } -/** @internal @knipignore */ +/** @internal */ export function hasTypeArguments(node: Node): node is HasTypeArguments { return !!(node as HasTypeArguments).typeArguments; } @@ -10829,7 +10823,7 @@ export function hasContextSensitiveParameters(node: FunctionLikeDeclaration): bo // an implicit 'this' parameter which is subject to contextual typing. const parameter = firstOrUndefined(node.parameters); if (!(parameter && parameterIsThisKeyword(parameter))) { - return true; + return !!(node.flags & NodeFlags.ContainsThis); } } } diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index fd8ce55f1405d..a19435e6ab996 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -6,7 +6,7 @@ interface String { /** * Matches a string with a regular expression, and returns an iterable of matches * containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. + * @param regexp A regular expression */ matchAll(regexp: RegExp): RegExpStringIterator; diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 865453a9b2dda..f6aadffe9d836 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8190,6 +8190,15 @@ + + + + + + + + + @@ -10635,11 +10644,11 @@ - + - + - + @@ -18630,6 +18639,15 @@ + + + + + + + + + @@ -19431,6 +19449,15 @@ + + + + + + + + + @@ -19494,6 +19521,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index fbd8011ed45b2..06e82626ac9cc 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -10635,11 +10635,11 @@ - + - + - + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index dd924c01fe574..5bd7de830eb55 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8199,6 +8199,15 @@ + + + + + + + + + @@ -10644,11 +10653,11 @@ - + - + - + @@ -18639,6 +18648,15 @@ + + + + + + + + + @@ -19440,6 +19458,15 @@ + + + + + + + + + @@ -19503,6 +19530,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index 8d92f2ae01f9b..193e9960fd17b 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -10632,11 +10632,11 @@ - + - + - + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 316bc6e76a9b0..9b55a11f80d05 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8202,6 +8202,15 @@ + + + + + + + + + @@ -10647,11 +10656,11 @@ - + - + - + @@ -18642,6 +18651,15 @@ + + + + + + + + + @@ -19443,6 +19461,15 @@ + + + + + + + + + @@ -19506,6 +19533,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6cbea6e048b20..4ee447a09d4c7 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8202,6 +8202,15 @@ + + + + + + + + + @@ -10647,11 +10656,11 @@ - + - + - + @@ -18642,6 +18651,15 @@ + + + + + + + + + @@ -19443,6 +19461,15 @@ + + + + + + + + + @@ -19506,6 +19533,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 7d4ac256878e5..06e92bffdac2b 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -10635,11 +10635,11 @@ - + - + - + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 8d2985e9e5bf0..807ea098ae7e0 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8190,6 +8190,15 @@ + + + + + + + + + @@ -10635,11 +10644,11 @@ - + - + - + @@ -18630,6 +18639,15 @@ + + + + + + + + + @@ -19431,6 +19449,15 @@ + + + + + + + + + @@ -19494,6 +19521,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index d8cd15eb269a3..ae819ed0d1f5d 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8190,6 +8190,15 @@ + + + + + + + + + @@ -10635,11 +10644,11 @@ - + - + - + @@ -18630,6 +18639,15 @@ + + + + + + + + + @@ -19431,6 +19449,15 @@ + + + + + + + + + @@ -19494,6 +19521,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6b01c320dcbbc..1e2e76b7c3419 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8180,6 +8180,15 @@ + + + + + + + + + @@ -10625,11 +10634,11 @@ - + - + - + @@ -18617,6 +18626,15 @@ + + + + + + + + + @@ -19418,6 +19436,15 @@ + + + + + + + + + @@ -19481,6 +19508,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9b903211f9db7..aa3f50b65bc51 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8183,6 +8183,15 @@ + + + + + + + + + @@ -10628,11 +10637,11 @@ - + - + - + @@ -18620,6 +18629,15 @@ + + + + + + + + + @@ -19421,6 +19439,15 @@ + + + + + + + + + @@ -19484,6 +19511,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index ffc3e7292feba..e1b48ca8bcbee 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -10634,11 +10634,11 @@ - + - + - + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 191ba55c786a6..be02d3039c136 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8183,6 +8183,15 @@ + + + + + + + + + @@ -10628,11 +10637,11 @@ - + - + - + @@ -18623,6 +18632,15 @@ + + + + + + + + + @@ -19424,6 +19442,15 @@ + + + + + + + + + @@ -19487,6 +19514,15 @@ + + + + + + + + + diff --git a/src/services/completions.ts b/src/services/completions.ts index fbb0cf9406436..28d29136dab89 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -3280,7 +3280,7 @@ function getContextualType(previousToken: Node, position: number, sourceFile: So isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) ? // completion at `x ===/**/` should be for the right side checker.getTypeAtLocation(parent.left) : - checker.getContextualType(previousToken as Expression, ContextFlags.Completions) || checker.getContextualType(previousToken as Expression); + checker.getContextualType(previousToken as Expression, ContextFlags.IgnoreNodeInferences) || checker.getContextualType(previousToken as Expression); } } @@ -3966,7 +3966,7 @@ function getCompletionData( // Cursor is inside a JSX self-closing element or opening element const attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes); if (!attrsType) return GlobalsSearch.Continue; - const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, ContextFlags.Completions); + const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, ContextFlags.IgnoreNodeInferences); symbols = concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties)); setSortTextToOptionalMember(); completionKind = CompletionKind.MemberLike; @@ -4564,7 +4564,7 @@ function getCompletionData( } return GlobalsSearch.Continue; } - const completionsType = typeChecker.getContextualType(objectLikeContainer, ContextFlags.Completions); + const completionsType = typeChecker.getContextualType(objectLikeContainer, ContextFlags.IgnoreNodeInferences); const hasStringIndexType = (completionsType || instantiatedType).getStringIndexType(); const hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType(); isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype; diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index b8b131ca3b56f..0a45cc3e3e9a0 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -6,6 +6,7 @@ import { CallLikeExpression, canHaveSymbol, concatenate, + ContextFlags, createTextSpan, createTextSpanFromBounds, createTextSpanFromNode, @@ -72,6 +73,8 @@ import { isNameOfFunctionDeclaration, isNewExpressionTarget, isObjectBindingPattern, + isObjectLiteralElementLike, + isObjectLiteralExpression, isPropertyName, isRightSideOfPropertyAccess, isStaticModifier, @@ -312,7 +315,17 @@ function getDefinitionFromObjectLiteralElement(typeChecker: TypeChecker, node: N if (element) { const contextualType = element && typeChecker.getContextualType(element.parent); if (contextualType) { - return flatMap(getPropertySymbolsFromContextualType(element, typeChecker, contextualType, /*unionSymbolOk*/ false), propertySymbol => getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + let properties = getPropertySymbolsFromContextualType(element, typeChecker, contextualType, /*unionSymbolOk*/ false); + if (some(properties, p => !!(p.valueDeclaration && isObjectLiteralExpression(p.valueDeclaration.parent) && isObjectLiteralElementLike(p.valueDeclaration) && p.valueDeclaration.name === node))) { + const withoutNodeInferencesType = typeChecker.getContextualType(element.parent, ContextFlags.IgnoreNodeInferences); + if (withoutNodeInferencesType) { + const withoutNodeInferencesProperties = getPropertySymbolsFromContextualType(element, typeChecker, withoutNodeInferencesType, /*unionSymbolOk*/ false); + if (withoutNodeInferencesProperties.length) { + properties = withoutNodeInferencesProperties; + } + } + } + return flatMap(properties, propertySymbol => getDefinitionFromSymbol(typeChecker, propertySymbol, node)); } } return emptyArray; diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index c6888d0aaee4d..42c72bd4ca998 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -91,6 +91,7 @@ import { isApplicableVersionedTypesKey, isArray, isCallExpression, + isCallLikeExpression, isIdentifier, isIdentifierText, isImportCall, @@ -429,7 +430,15 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL // }); return stringLiteralCompletionsForObjectLiteral(typeChecker, parent.parent); } - return fromContextualType() || fromContextualType(ContextFlags.None); + if (findAncestor(parent.parent, isCallLikeExpression)) { + const uniques = new Set(); + const stringLiteralTypes = concatenate( + getStringLiteralTypes(typeChecker.getContextualType(node, ContextFlags.None), uniques), + getStringLiteralTypes(typeChecker.getContextualType(node, ContextFlags.IgnoreNodeInferences), uniques), + ); + return toStringLiteralCompletionsFromTypes(stringLiteralTypes); + } + return fromContextualType(ContextFlags.None); case SyntaxKind.ElementAccessExpression: { const { expression, argumentExpression } = parent as ElementAccessExpression; @@ -553,17 +562,17 @@ function getStringLiteralCompletionEntries(sourceFile: SourceFile, node: StringL } } - function fromContextualType(contextFlags: ContextFlags = ContextFlags.Completions): StringLiteralCompletionsFromTypes | undefined { + function fromContextualType(contextFlags: ContextFlags = ContextFlags.IgnoreNodeInferences): StringLiteralCompletionsFromTypes | undefined { // Get completion for string literal from string literal type // i.e. var x: "hi" | "hello" = "/*completion position*/" - const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); - if (!types.length) { - return; - } - return { kind: StringLiteralCompletionKind.Types, types, isNewIdentifier: false }; + return toStringLiteralCompletionsFromTypes(getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags))); } } +function toStringLiteralCompletionsFromTypes(types: readonly StringLiteralType[]): StringLiteralCompletionsFromTypes | undefined { + return types.length ? { kind: StringLiteralCompletionKind.Types, types, isNewIdentifier: false } : undefined; +} + function walkUpParentheses(node: Node) { switch (node.kind) { case SyntaxKind.ParenthesizedType: @@ -611,7 +620,7 @@ function stringLiteralCompletionsForObjectLiteral(checker: TypeChecker, objectLi const contextualType = checker.getContextualType(objectLiteralExpression); if (!contextualType) return undefined; - const completionsType = checker.getContextualType(objectLiteralExpression, ContextFlags.Completions); + const completionsType = checker.getContextualType(objectLiteralExpression, ContextFlags.IgnoreNodeInferences); const symbols = getPropertiesForObjectExpression( contextualType, completionsType, diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index 5529cc87b35ca..6d164855b4f22 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -119,6 +119,7 @@ export * from "./unittests/tsc/composite.js"; export * from "./unittests/tsc/declarationEmit.js"; export * from "./unittests/tsc/extends.js"; export * from "./unittests/tsc/forceConsistentCasingInFileNames.js"; +export * from "./unittests/tsc/ignoreConfig.js"; export * from "./unittests/tsc/incremental.js"; export * from "./unittests/tsc/libraryResolution.js"; export * from "./unittests/tsc/listFilesOnly.js"; diff --git a/src/testRunner/unittests/tsc/ignoreConfig.ts b/src/testRunner/unittests/tsc/ignoreConfig.ts new file mode 100644 index 0000000000000..722717150d6c0 --- /dev/null +++ b/src/testRunner/unittests/tsc/ignoreConfig.ts @@ -0,0 +1,58 @@ +import * as ts from "../../_namespaces/ts.js"; +import { jsonToReadableText } from "../helpers.js"; +import { verifyTsc } from "../helpers/tsc.js"; +import { TestServerHost } from "../helpers/virtualFileSystemWithWatch.js"; + +describe("unittests:: tsc:: ignoreConfig::", () => { + function sysWithoutConfig() { + return TestServerHost.createWatchedSystem({ + "/home/src/workspaces/project/src/a.ts": "export const a = 10;", + "/home/src/workspaces/project/src/b.ts": "export const b = 10;", + "/home/src/workspaces/project/c.ts": "export const c = 10;", + }); + } + function sysWithConfig() { + const sys = sysWithoutConfig(); + sys.writeFile( + "/home/src/workspaces/project/tsconfig.json", + jsonToReadableText({ + include: ["src"], + }), + ); + return sys; + } + function runScenario(subScenario: string, commandLineArgs: readonly string[]) { + verifyTsc({ + scenario: "ignoreConfig", + subScenario, + sys: sysWithConfig, + commandLineArgs, + }); + + verifyTsc({ + scenario: "ignoreConfig", + subScenario: subScenario + " with --ignoreConfig", + sys: sysWithConfig, + commandLineArgs: commandLineArgs.concat("--ignoreConfig"), + }); + + verifyTsc({ + scenario: "ignoreConfig", + subScenario: subScenario + " when config file absent", + sys: sysWithoutConfig, + commandLineArgs, + }); + + verifyTsc({ + scenario: "ignoreConfig", + subScenario: subScenario + " when config file absent with --ignoreConfig", + sys: sysWithoutConfig, + commandLineArgs: commandLineArgs.concat("--ignoreConfig"), + }); + } + + runScenario("without any options", ts.emptyArray); + runScenario("specifying files", ["src/a.ts"]); + runScenario("specifying project", ["-p", "."]); + runScenario("mixing project and files", ["-p", ".", "src/a.ts", "c.ts"]); +}); diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index 267ef8cb5c4ed..fcf41017d3752 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -424,7 +424,7 @@ declare module "fs" { ], }); } - verifyIgnore("watch without configFile", ["--w", `/user/username/projects/myproject/test.ts`]); + verifyIgnore("watch without configFile", ["--w", "--ignoreConfig", `/user/username/projects/myproject/test.ts`]); verifyIgnore("watch with configFile", ["--w", "-p", `/user/username/projects/myproject/tsconfig.json`]); }); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt index 715c39f146bb3..c62c22a8b8117 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt @@ -14,7 +14,7 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error } } - module A{ + namespace A{ // expected error export class Point { ~~~~~ diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js index 47a5b2126df58..f5285b0f7de52 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js @@ -8,7 +8,7 @@ namespace A { } } -module A{ +namespace A{ // expected error export class Point { origin: number; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.symbols index 0a717333d4528..bbf68ed6428a2 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.symbols +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.symbols @@ -15,12 +15,12 @@ namespace A { } } -module A{ +namespace A{ >A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 5, 1)) // expected error export class Point { ->Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 7, 9)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 7, 12)) origin: number; >origin : Symbol(Point.origin, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 9, 24)) diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.types index bf99414a04bc1..e0f784f6aa484 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.types @@ -19,7 +19,7 @@ namespace A { } } -module A{ +namespace A{ >A : typeof A > : ^^^^^^^^ diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js index be607bb5c0a85..e7ee79902558f 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js @@ -5,7 +5,7 @@ namespace A.B { export var x: number; } -module A{ +namespace A{ namespace B { export var x: string; } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols index 7c78b6d104bbb..9fadf3a04f230 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols @@ -9,11 +9,11 @@ namespace A.B { >x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14)) } -module A{ +namespace A{ >A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1)) namespace B { ->B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 9)) +>B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 12)) export var x: string; >x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 6, 18)) diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types index c32af0d51d3a7..0464cd9ad5fea 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types @@ -12,7 +12,7 @@ namespace A.B { > : ^^^^^^ } -module A{ +namespace A{ >A : typeof A > : ^^^^^^^^ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index ba6404355b3c3..6ca73b0b2fe8b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -7,7 +7,7 @@ License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +MERCHANTABILITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt b/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt deleted file mode 100644 index f660ba308682e..0000000000000 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -asiPreventsParsingAsNamespace04.ts(2,1): error TS2304: Cannot find name 'namespace'. - - -==== asiPreventsParsingAsNamespace04.ts (1 errors) ==== - let module = 10; - namespace in {} - ~~~~~~~~~ -!!! error TS2304: Cannot find name 'namespace'. \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js index 6b2613cd272d1..027b839404df2 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js @@ -2,8 +2,8 @@ //// [asiPreventsParsingAsNamespace04.ts] let module = 10; -namespace in {} +module in {} //// [asiPreventsParsingAsNamespace04.js] var module = 10; -namespace in {}; +module in {}; diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols b/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols index c2ef43fea158d..64818185e42f0 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.symbols @@ -4,4 +4,6 @@ let module = 10; >module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 0, 3)) -namespace in {} +module in {} +>module : Symbol(module, Decl(asiPreventsParsingAsNamespace04.ts, 0, 3)) + diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types index 964cef9f6b09e..93d3b6662dd80 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types @@ -7,11 +7,11 @@ let module = 10; >10 : 10 > : ^^ -namespace in {} ->namespace in {} : boolean -> : ^^^^^^^ ->namespace : any -> : ^^^ +module in {} +>module in {} : boolean +> : ^^^^^^^ +>module : number +> : ^^^^^^ >{} : {} > : ^^ diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt index 0334a104e0474..008722a48e7e6 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt @@ -1,21 +1,23 @@ awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(46,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(51,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(58,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(63,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(68,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(71,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(78,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(81,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(96,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(101,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(105,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -==== awaitUsingDeclarations.1.ts (15 errors) ==== +==== awaitUsingDeclarations.1.ts (17 errors) ==== await using d1 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. @@ -59,64 +61,79 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + ~~~~~ +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + ~~~~~ +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; @@ -124,20 +141,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).js b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).js index 6468ced72c728..60df8d3d89571 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).js +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).js @@ -40,61 +40,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; @@ -176,247 +187,244 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar }; function af() { return __awaiter(this, void 0, void 0, function* () { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_15, { [Symbol.asyncDispose]() { + const d3 = __addDisposableResource(env_18, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); yield null; } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - const result_15 = __disposeResources(env_15); - if (result_15) - yield result_15; + const result_18 = __disposeResources(env_18); + if (result_18) + yield result_18; } }); } function ag() { return __asyncGenerator(this, arguments, function* ag_1() { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_16, { [Symbol.asyncDispose]() { + const d5 = __addDisposableResource(env_19, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); yield yield __await(void 0); yield __await(null); } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - const result_16 = __disposeResources(env_16); - if (result_16) - yield __await(result_16); + const result_19 = __disposeResources(env_19); + if (result_19) + yield __await(result_19); } }); } -var d1, a, C1, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { [Symbol.asyncDispose]() { + d1 = __addDisposableResource(env_1, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); a = () => __awaiter(void 0, void 0, void 0, function* () { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_17, { [Symbol.asyncDispose]() { + const d6 = __addDisposableResource(env_20, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - const result_17 = __disposeResources(env_17); - if (result_17) - yield result_17; + const result_20 = __disposeResources(env_20); + if (result_20) + yield result_20; } }); C1 = class C1 { constructor() { this.a = () => __awaiter(this, void 0, void 0, function* () { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_18, { [Symbol.asyncDispose]() { + const d7 = __addDisposableResource(env_21, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - const result_18 = __disposeResources(env_18); - if (result_18) - yield result_18; + const result_21 = __disposeResources(env_21); + if (result_21) + yield result_21; } }); } am() { return __awaiter(this, void 0, void 0, function* () { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_19, { [Symbol.asyncDispose]() { + const d13 = __addDisposableResource(env_22, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); yield null; } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - const result_19 = __disposeResources(env_19); - if (result_19) - yield result_19; + const result_22 = __disposeResources(env_22); + if (result_22) + yield result_22; } }); } ag() { return __asyncGenerator(this, arguments, function* ag_2() { - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_20, { [Symbol.asyncDispose]() { + const d15 = __addDisposableResource(env_23, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); yield yield __await(void 0); yield __await(null); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - const result_20 = __disposeResources(env_20); - if (result_20) - yield __await(result_20); + const result_23 = __disposeResources(env_23); + if (result_23) + yield __await(result_23); } }); } }; { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { [Symbol.asyncDispose]() { + const d19 = __addDisposableResource(env_2, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - const result_1 = __disposeResources(env_3); + const result_1 = __disposeResources(env_2); if (result_1) await result_1; } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { [Symbol.asyncDispose]() { + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); break; - case 1: - const d21 = __addDisposableResource(env_1, { [Symbol.asyncDispose]() { + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + const result_2 = __disposeResources(env_3); + if (result_2) + await result_2; + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + const result_3 = __disposeResources(env_4); + if (result_3) + await result_3; + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { [Symbol.asyncDispose]() { + return __awaiter(this, void 0, void 0, function* () { }); + } }, true); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + const result_4 = __disposeResources(env_5); + if (result_4) + await result_4; + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - const result_2 = __disposeResources(env_1); - if (result_2) - await result_2; - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { [Symbol.asyncDispose]() { + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + const result_5 = __disposeResources(env_6); + if (result_5) + await result_5; + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { [Symbol.asyncDispose]() { + return __awaiter(this, void 0, void 0, function* () { }); + } }, true); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + const result_6 = __disposeResources(env_7); + if (result_6) + await result_6; + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - const result_3 = __disposeResources(env_4); - if (result_3) - await result_3; - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { [Symbol.asyncDispose]() { - return __awaiter(this, void 0, void 0, function* () { }); - } }, true); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - const result_4 = __disposeResources(env_5); - if (result_4) - await result_4; - } - } - catch (_a) { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { [Symbol.asyncDispose]() { - return __awaiter(this, void 0, void 0, function* () { }); - } }, true); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - const result_5 = __disposeResources(env_6); - if (result_5) - await result_5; - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { [Symbol.asyncDispose]() { - return __awaiter(this, void 0, void 0, function* () { }); - } }, true); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - const result_6 = __disposeResources(env_7); - if (result_6) - await result_6; - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { [Symbol.asyncDispose]() { + const d25 = __addDisposableResource(env_8, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); } @@ -430,10 +438,10 @@ try { await result_7; } } - else { + catch (_a) { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { [Symbol.asyncDispose]() { + const d26 = __addDisposableResource(env_9, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); } @@ -447,13 +455,12 @@ try { await result_8; } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { [Symbol.asyncDispose]() { + const d27 = __addDisposableResource(env_10, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); - break; } catch (e_9) { env_10.error = e_9; @@ -465,13 +472,12 @@ try { await result_9; } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { [Symbol.asyncDispose]() { + const d28 = __addDisposableResource(env_11, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); - break; } catch (e_10) { env_11.error = e_10; @@ -482,14 +488,13 @@ try { if (result_10) await result_10; } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { [Symbol.asyncDispose]() { + const d29 = __addDisposableResource(env_12, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); - break; } catch (e_11) { env_12.error = e_11; @@ -501,12 +506,13 @@ try { await result_11; } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { [Symbol.asyncDispose]() { + const d30 = __addDisposableResource(env_13, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); + break; } catch (e_12) { env_13.error = e_12; @@ -518,12 +524,13 @@ try { await result_12; } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { [Symbol.asyncDispose]() { + const d31 = __addDisposableResource(env_14, { [Symbol.asyncDispose]() { return __awaiter(this, void 0, void 0, function* () { }); } }, true); + break; } catch (e_13) { env_14.error = e_13; @@ -534,15 +541,67 @@ try { if (result_13) await result_13; } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { [Symbol.asyncDispose]() { + return __awaiter(this, void 0, void 0, function* () { }); + } }, true); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + const result_14 = __disposeResources(env_15); + if (result_14) + await result_14; + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { [Symbol.asyncDispose]() { + return __awaiter(this, void 0, void 0, function* () { }); + } }, true); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + const result_15 = __disposeResources(env_16); + if (result_15) + await result_15; + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { [Symbol.asyncDispose]() { + return __awaiter(this, void 0, void 0, function* () { }); + } }, true); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + const result_16 = __disposeResources(env_17); + if (result_16) + await result_16; + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - const result_14 = __disposeResources(env_2); - if (result_14) - await result_14; + const result_17 = __disposeResources(env_1); + if (result_17) + await result_17; } export {}; diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2017).js b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2017).js index 1277db5bcdd32..f6772181681bb 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2017).js +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2017).js @@ -40,61 +40,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; @@ -166,216 +177,215 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; async function af() { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_15, { async [Symbol.asyncDispose]() { } }, true); + const d3 = __addDisposableResource(env_18, { async [Symbol.asyncDispose]() { } }, true); await null; } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - const result_15 = __disposeResources(env_15); - if (result_15) - await result_15; + const result_18 = __disposeResources(env_18); + if (result_18) + await result_18; } } function ag() { return __asyncGenerator(this, arguments, function* ag_1() { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_16, { async [Symbol.asyncDispose]() { } }, true); + const d5 = __addDisposableResource(env_19, { async [Symbol.asyncDispose]() { } }, true); yield yield __await(void 0); yield __await(null); } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - const result_16 = __disposeResources(env_16); - if (result_16) - yield __await(result_16); + const result_19 = __disposeResources(env_19); + if (result_19) + yield __await(result_19); } }); } -var d1, a, C1, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { async [Symbol.asyncDispose]() { } }, true); + d1 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); a = async () => { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_17, { async [Symbol.asyncDispose]() { } }, true); + const d6 = __addDisposableResource(env_20, { async [Symbol.asyncDispose]() { } }, true); } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - const result_17 = __disposeResources(env_17); - if (result_17) - await result_17; + const result_20 = __disposeResources(env_20); + if (result_20) + await result_20; } }; C1 = class C1 { constructor() { this.a = async () => { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_18, { async [Symbol.asyncDispose]() { } }, true); + const d7 = __addDisposableResource(env_21, { async [Symbol.asyncDispose]() { } }, true); } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - const result_18 = __disposeResources(env_18); - if (result_18) - await result_18; + const result_21 = __disposeResources(env_21); + if (result_21) + await result_21; } }; } async am() { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_19, { async [Symbol.asyncDispose]() { } }, true); + const d13 = __addDisposableResource(env_22, { async [Symbol.asyncDispose]() { } }, true); await null; } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - const result_19 = __disposeResources(env_19); - if (result_19) - await result_19; + const result_22 = __disposeResources(env_22); + if (result_22) + await result_22; } } ag() { return __asyncGenerator(this, arguments, function* ag_2() { - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_20, { async [Symbol.asyncDispose]() { } }, true); + const d15 = __addDisposableResource(env_23, { async [Symbol.asyncDispose]() { } }, true); yield yield __await(void 0); yield __await(null); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - const result_20 = __disposeResources(env_20); - if (result_20) - yield __await(result_20); + const result_23 = __disposeResources(env_23); + if (result_23) + yield __await(result_23); } }); } }; { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { async [Symbol.asyncDispose]() { } }, true); + const d19 = __addDisposableResource(env_2, { async [Symbol.asyncDispose]() { } }, true); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - const result_1 = __disposeResources(env_3); + const result_1 = __disposeResources(env_2); if (result_1) await result_1; } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { async [Symbol.asyncDispose]() { } }, true); break; - case 1: - const d21 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + const result_2 = __disposeResources(env_3); + if (result_2) + await result_2; + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { async [Symbol.asyncDispose]() { } }, true); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + const result_3 = __disposeResources(env_4); + if (result_3) + await result_3; + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + const result_4 = __disposeResources(env_5); + if (result_4) + await result_4; + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - const result_2 = __disposeResources(env_1); - if (result_2) - await result_2; - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { async [Symbol.asyncDispose]() { } }, true); + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { async [Symbol.asyncDispose]() { } }, true); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + const result_5 = __disposeResources(env_6); + if (result_5) + await result_5; + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + const result_6 = __disposeResources(env_7); + if (result_6) + await result_6; + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - const result_3 = __disposeResources(env_4); - if (result_3) - await result_3; - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - const result_4 = __disposeResources(env_5); - if (result_4) - await result_4; - } - } - catch (_a) { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - const result_5 = __disposeResources(env_6); - if (result_5) - await result_5; - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - const result_6 = __disposeResources(env_7); - if (result_6) - await result_6; - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { async [Symbol.asyncDispose]() { } }, true); + const d25 = __addDisposableResource(env_8, { async [Symbol.asyncDispose]() { } }, true); } catch (e_7) { env_8.error = e_7; @@ -387,10 +397,10 @@ try { await result_7; } } - else { + catch (_a) { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { async [Symbol.asyncDispose]() { } }, true); + const d26 = __addDisposableResource(env_9, { async [Symbol.asyncDispose]() { } }, true); } catch (e_8) { env_9.error = e_8; @@ -402,11 +412,10 @@ try { await result_8; } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { async [Symbol.asyncDispose]() { } }, true); - break; + const d27 = __addDisposableResource(env_10, { async [Symbol.asyncDispose]() { } }, true); } catch (e_9) { env_10.error = e_9; @@ -418,11 +427,10 @@ try { await result_9; } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { async [Symbol.asyncDispose]() { } }, true); - break; + const d28 = __addDisposableResource(env_11, { async [Symbol.asyncDispose]() { } }, true); } catch (e_10) { env_11.error = e_10; @@ -433,12 +441,11 @@ try { if (result_10) await result_10; } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { async [Symbol.asyncDispose]() { } }, true); - break; + const d29 = __addDisposableResource(env_12, { async [Symbol.asyncDispose]() { } }, true); } catch (e_11) { env_12.error = e_11; @@ -450,10 +457,11 @@ try { await result_11; } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { async [Symbol.asyncDispose]() { } }, true); + const d30 = __addDisposableResource(env_13, { async [Symbol.asyncDispose]() { } }, true); + break; } catch (e_12) { env_13.error = e_12; @@ -465,10 +473,11 @@ try { await result_12; } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { async [Symbol.asyncDispose]() { } }, true); + const d31 = __addDisposableResource(env_14, { async [Symbol.asyncDispose]() { } }, true); + break; } catch (e_13) { env_14.error = e_13; @@ -479,15 +488,61 @@ try { if (result_13) await result_13; } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { async [Symbol.asyncDispose]() { } }, true); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + const result_14 = __disposeResources(env_15); + if (result_14) + await result_14; + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + const result_15 = __disposeResources(env_16); + if (result_15) + await result_15; + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + const result_16 = __disposeResources(env_17); + if (result_16) + await result_16; + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - const result_14 = __disposeResources(env_2); - if (result_14) - await result_14; + const result_17 = __disposeResources(env_1); + if (result_17) + await result_17; } export {}; diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2022).js b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2022).js index 9c660646ccf39..867a1d582f2cb 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2022).js +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2022).js @@ -40,61 +40,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; @@ -153,210 +164,209 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }); async function af() { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_15, { async [Symbol.asyncDispose]() { } }, true); + const d3 = __addDisposableResource(env_18, { async [Symbol.asyncDispose]() { } }, true); await null; } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - const result_15 = __disposeResources(env_15); - if (result_15) - await result_15; + const result_18 = __disposeResources(env_18); + if (result_18) + await result_18; } } async function* ag() { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_16, { async [Symbol.asyncDispose]() { } }, true); + const d5 = __addDisposableResource(env_19, { async [Symbol.asyncDispose]() { } }, true); yield; await null; } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - const result_16 = __disposeResources(env_16); - if (result_16) - await result_16; + const result_19 = __disposeResources(env_19); + if (result_19) + await result_19; } } -var d1, a, C1, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { async [Symbol.asyncDispose]() { } }, true); + d1 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); a = async () => { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_17, { async [Symbol.asyncDispose]() { } }, true); + const d6 = __addDisposableResource(env_20, { async [Symbol.asyncDispose]() { } }, true); } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - const result_17 = __disposeResources(env_17); - if (result_17) - await result_17; + const result_20 = __disposeResources(env_20); + if (result_20) + await result_20; } }; C1 = class C1 { a = async () => { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_18, { async [Symbol.asyncDispose]() { } }, true); + const d7 = __addDisposableResource(env_21, { async [Symbol.asyncDispose]() { } }, true); } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - const result_18 = __disposeResources(env_18); - if (result_18) - await result_18; + const result_21 = __disposeResources(env_21); + if (result_21) + await result_21; } }; async am() { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_19, { async [Symbol.asyncDispose]() { } }, true); + const d13 = __addDisposableResource(env_22, { async [Symbol.asyncDispose]() { } }, true); await null; } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - const result_19 = __disposeResources(env_19); - if (result_19) - await result_19; + const result_22 = __disposeResources(env_22); + if (result_22) + await result_22; } } async *ag() { - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_20, { async [Symbol.asyncDispose]() { } }, true); + const d15 = __addDisposableResource(env_23, { async [Symbol.asyncDispose]() { } }, true); yield; await null; } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - const result_20 = __disposeResources(env_20); - if (result_20) - await result_20; + const result_23 = __disposeResources(env_23); + if (result_23) + await result_23; } } }; { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { async [Symbol.asyncDispose]() { } }, true); + const d19 = __addDisposableResource(env_2, { async [Symbol.asyncDispose]() { } }, true); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - const result_1 = __disposeResources(env_3); + const result_1 = __disposeResources(env_2); if (result_1) await result_1; } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { async [Symbol.asyncDispose]() { } }, true); break; - case 1: - const d21 = __addDisposableResource(env_1, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + const result_2 = __disposeResources(env_3); + if (result_2) + await result_2; + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { async [Symbol.asyncDispose]() { } }, true); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + const result_3 = __disposeResources(env_4); + if (result_3) + await result_3; + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + const result_4 = __disposeResources(env_5); + if (result_4) + await result_4; + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - const result_2 = __disposeResources(env_1); - if (result_2) - await result_2; - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { async [Symbol.asyncDispose]() { } }, true); + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { async [Symbol.asyncDispose]() { } }, true); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + const result_5 = __disposeResources(env_6); + if (result_5) + await result_5; + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + const result_6 = __disposeResources(env_7); + if (result_6) + await result_6; + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - const result_3 = __disposeResources(env_4); - if (result_3) - await result_3; - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - const result_4 = __disposeResources(env_5); - if (result_4) - await result_4; - } - } - catch { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - const result_5 = __disposeResources(env_6); - if (result_5) - await result_5; - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { async [Symbol.asyncDispose]() { } }, true); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - const result_6 = __disposeResources(env_7); - if (result_6) - await result_6; - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { async [Symbol.asyncDispose]() { } }, true); + const d25 = __addDisposableResource(env_8, { async [Symbol.asyncDispose]() { } }, true); } catch (e_7) { env_8.error = e_7; @@ -368,10 +378,10 @@ try { await result_7; } } - else { + catch { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { async [Symbol.asyncDispose]() { } }, true); + const d26 = __addDisposableResource(env_9, { async [Symbol.asyncDispose]() { } }, true); } catch (e_8) { env_9.error = e_8; @@ -383,11 +393,10 @@ try { await result_8; } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { async [Symbol.asyncDispose]() { } }, true); - break; + const d27 = __addDisposableResource(env_10, { async [Symbol.asyncDispose]() { } }, true); } catch (e_9) { env_10.error = e_9; @@ -399,11 +408,10 @@ try { await result_9; } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { async [Symbol.asyncDispose]() { } }, true); - break; + const d28 = __addDisposableResource(env_11, { async [Symbol.asyncDispose]() { } }, true); } catch (e_10) { env_11.error = e_10; @@ -414,12 +422,11 @@ try { if (result_10) await result_10; } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { async [Symbol.asyncDispose]() { } }, true); - break; + const d29 = __addDisposableResource(env_12, { async [Symbol.asyncDispose]() { } }, true); } catch (e_11) { env_12.error = e_11; @@ -431,10 +438,11 @@ try { await result_11; } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { async [Symbol.asyncDispose]() { } }, true); + const d30 = __addDisposableResource(env_13, { async [Symbol.asyncDispose]() { } }, true); + break; } catch (e_12) { env_13.error = e_12; @@ -446,10 +454,11 @@ try { await result_12; } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { async [Symbol.asyncDispose]() { } }, true); + const d31 = __addDisposableResource(env_14, { async [Symbol.asyncDispose]() { } }, true); + break; } catch (e_13) { env_14.error = e_13; @@ -460,15 +469,61 @@ try { if (result_13) await result_13; } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { async [Symbol.asyncDispose]() { } }, true); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + const result_14 = __disposeResources(env_15); + if (result_14) + await result_14; + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + const result_15 = __disposeResources(env_16); + if (result_15) + await result_15; + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { async [Symbol.asyncDispose]() { } }, true); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + const result_16 = __disposeResources(env_17); + if (result_16) + await result_16; + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - const result_14 = __disposeResources(env_2); - if (result_14) - await result_14; + const result_17 = __disposeResources(env_1); + if (result_17) + await result_17; } export {}; diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt index 0334a104e0474..008722a48e7e6 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt @@ -1,21 +1,23 @@ awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(46,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(51,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(58,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(63,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(68,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(71,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(78,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(81,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(96,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(101,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(105,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -==== awaitUsingDeclarations.1.ts (15 errors) ==== +==== awaitUsingDeclarations.1.ts (17 errors) ==== await using d1 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. @@ -59,64 +61,79 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + ~~~~~ +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + ~~~~~ +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; @@ -124,20 +141,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; ~~~~~ !!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).js b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).js index eb4005130a99b..a3dbd289b99bd 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).js +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).js @@ -40,61 +40,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; @@ -201,19 +212,19 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s; function af() { return __awaiter(this, void 0, void 0, function () { - var env_15, d3, e_15, result_15; + var env_18, d3, e_18, result_18; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_15 = { stack: [], error: void 0, hasError: false }; + env_18 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 7]); - d3 = __addDisposableResource(env_15, (_a = {}, _a[Symbol.asyncDispose] = function () { + d3 = __addDisposableResource(env_18, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); @@ -223,14 +234,14 @@ function af() { _b.sent(); return [3 /*break*/, 7]; case 3: - e_15 = _b.sent(); - env_15.error = e_15; - env_15.hasError = true; + e_18 = _b.sent(); + env_18.error = e_18; + env_18.hasError = true; return [3 /*break*/, 7]; case 4: - result_15 = __disposeResources(env_15); - if (!result_15) return [3 /*break*/, 6]; - return [4 /*yield*/, result_15]; + result_18 = __disposeResources(env_18); + if (!result_18) return [3 /*break*/, 6]; + return [4 /*yield*/, result_18]; case 5: _b.sent(); _b.label = 6; @@ -242,16 +253,16 @@ function af() { } function ag() { return __asyncGenerator(this, arguments, function ag_1() { - var env_16, d5, e_16, result_16; + var env_19, d5, e_19, result_19; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_16 = { stack: [], error: void 0, hasError: false }; + env_19 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 5, 6, 9]); - d5 = __addDisposableResource(env_16, (_a = {}, _a[Symbol.asyncDispose] = function () { + d5 = __addDisposableResource(env_19, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); @@ -265,14 +276,14 @@ function ag() { _b.sent(); return [3 /*break*/, 9]; case 5: - e_16 = _b.sent(); - env_16.error = e_16; - env_16.hasError = true; + e_19 = _b.sent(); + env_19.error = e_19; + env_19.hasError = true; return [3 /*break*/, 9]; case 6: - result_16 = __disposeResources(env_16); - if (!result_16) return [3 /*break*/, 8]; - return [4 /*yield*/, __await(result_16)]; + result_19 = __disposeResources(env_19); + if (!result_19) return [3 /*break*/, 8]; + return [4 /*yield*/, __await(result_19)]; case 7: _b.sent(); _b.label = 8; @@ -282,39 +293,39 @@ function ag() { }); }); } -var d1, a, C1, env_1; -var env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1; +var env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, (_a = {}, _a[Symbol.asyncDispose] = function () { + d1 = __addDisposableResource(env_1, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _a), true); a = function () { return __awaiter(void 0, void 0, void 0, function () { - var env_17, d6, e_17, result_17; + var env_20, d6, e_20, result_20; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_17 = { stack: [], error: void 0, hasError: false }; + env_20 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 2, 3, 6]); - d6 = __addDisposableResource(env_17, (_a = {}, _a[Symbol.asyncDispose] = function () { + d6 = __addDisposableResource(env_20, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _a), true); return [3 /*break*/, 6]; case 2: - e_17 = _b.sent(); - env_17.error = e_17; - env_17.hasError = true; + e_20 = _b.sent(); + env_20.error = e_20; + env_20.hasError = true; return [3 /*break*/, 6]; case 3: - result_17 = __disposeResources(env_17); - if (!result_17) return [3 /*break*/, 5]; - return [4 /*yield*/, result_17]; + result_20 = __disposeResources(env_20); + if (!result_20) return [3 /*break*/, 5]; + return [4 /*yield*/, result_20]; case 4: _b.sent(); _b.label = 5; @@ -327,30 +338,30 @@ try { function C1() { var _this = this; this.a = function () { return __awaiter(_this, void 0, void 0, function () { - var env_18, d7, e_18, result_18; + var env_21, d7, e_21, result_21; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_18 = { stack: [], error: void 0, hasError: false }; + env_21 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 2, 3, 6]); - d7 = __addDisposableResource(env_18, (_a = {}, _a[Symbol.asyncDispose] = function () { + d7 = __addDisposableResource(env_21, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _a), true); return [3 /*break*/, 6]; case 2: - e_18 = _b.sent(); - env_18.error = e_18; - env_18.hasError = true; + e_21 = _b.sent(); + env_21.error = e_21; + env_21.hasError = true; return [3 /*break*/, 6]; case 3: - result_18 = __disposeResources(env_18); - if (!result_18) return [3 /*break*/, 5]; - return [4 /*yield*/, result_18]; + result_21 = __disposeResources(env_21); + if (!result_21) return [3 /*break*/, 5]; + return [4 /*yield*/, result_21]; case 4: _b.sent(); _b.label = 5; @@ -362,16 +373,16 @@ try { } C1.prototype.am = function () { return __awaiter(this, void 0, void 0, function () { - var env_19, d13, e_19, result_19; + var env_22, d13, e_22, result_22; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_19 = { stack: [], error: void 0, hasError: false }; + env_22 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 7]); - d13 = __addDisposableResource(env_19, (_a = {}, _a[Symbol.asyncDispose] = function () { + d13 = __addDisposableResource(env_22, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); @@ -381,14 +392,14 @@ try { _b.sent(); return [3 /*break*/, 7]; case 3: - e_19 = _b.sent(); - env_19.error = e_19; - env_19.hasError = true; + e_22 = _b.sent(); + env_22.error = e_22; + env_22.hasError = true; return [3 /*break*/, 7]; case 4: - result_19 = __disposeResources(env_19); - if (!result_19) return [3 /*break*/, 6]; - return [4 /*yield*/, result_19]; + result_22 = __disposeResources(env_22); + if (!result_22) return [3 /*break*/, 6]; + return [4 /*yield*/, result_22]; case 5: _b.sent(); _b.label = 6; @@ -400,16 +411,16 @@ try { }; C1.prototype.ag = function () { return __asyncGenerator(this, arguments, function ag_2() { - var env_20, d15, e_20, result_20; + var env_23, d15, e_23, result_23; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_20 = { stack: [], error: void 0, hasError: false }; + env_23 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 5, 6, 9]); - d15 = __addDisposableResource(env_20, (_a = {}, _a[Symbol.asyncDispose] = function () { + d15 = __addDisposableResource(env_23, (_a = {}, _a[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); @@ -423,14 +434,14 @@ try { _b.sent(); return [3 /*break*/, 9]; case 5: - e_20 = _b.sent(); - env_20.error = e_20; - env_20.hasError = true; + e_23 = _b.sent(); + env_23.error = e_23; + env_23.hasError = true; return [3 /*break*/, 9]; case 6: - result_20 = __disposeResources(env_20); - if (!result_20) return [3 /*break*/, 8]; - return [4 /*yield*/, __await(result_20)]; + result_23 = __disposeResources(env_23); + if (!result_23) return [3 /*break*/, 8]; + return [4 /*yield*/, __await(result_23)]; case 7: _b.sent(); _b.label = 8; @@ -443,140 +454,135 @@ try { return C1; }()); { - var env_3 = { stack: [], error: void 0, hasError: false }; + var env_2 = { stack: [], error: void 0, hasError: false }; try { - var d19 = __addDisposableResource(env_3, (_b = {}, _b[Symbol.asyncDispose] = function () { + var d19 = __addDisposableResource(env_2, (_b = {}, _b[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _b), true); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - var result_1 = __disposeResources(env_3); + var result_1 = __disposeResources(env_2); if (result_1) await result_1; } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - var d20 = __addDisposableResource(env_1, (_c = {}, _c[Symbol.asyncDispose] = function () { + switch (Math.random()) { + case 0: { + var env_3 = { stack: [], error: void 0, hasError: false }; + try { + var d20 = __addDisposableResource(env_3, (_c = {}, _c[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _c), true); break; - case 1: - var d21 = __addDisposableResource(env_1, (_d = {}, _d[Symbol.asyncDispose] = function () { + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + var result_2 = __disposeResources(env_3); + if (result_2) + await result_2; + } + } + case 1: { + var env_4 = { stack: [], error: void 0, hasError: false }; + try { + var d21 = __addDisposableResource(env_4, (_d = {}, _d[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }, _d), true); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + var result_3 = __disposeResources(env_4); + if (result_3) + await result_3; + } + } + default: { + var env_5 = { stack: [], error: void 0, hasError: false }; + try { + var d22 = __addDisposableResource(env_5, (_e = {}, _e[Symbol.asyncDispose] = function () { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }, _e), true); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + var result_4 = __disposeResources(env_5); + if (result_4) + await result_4; + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - var result_2 = __disposeResources(env_1); - if (result_2) - await result_2; - } - if (true) { - var env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - var d22 = __addDisposableResource(env_4, (_e = {}, _e[Symbol.asyncDispose] = function () { + if (true) + switch (0) { + case 0: { + var env_6 = { stack: [], error: void 0, hasError: false }; + try { + var d23 = __addDisposableResource(env_6, (_f = {}, _f[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _e), true); + }, _f), true); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + var result_5 = __disposeResources(env_6); + if (result_5) + await result_5; + } + } + default: { + var env_7 = { stack: [], error: void 0, hasError: false }; + try { + var d24 = __addDisposableResource(env_7, (_g = {}, _g[Symbol.asyncDispose] = function () { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }, _g), true); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + var result_6 = __disposeResources(env_7); + if (result_6) + await result_6; + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - var result_3 = __disposeResources(env_4); - if (result_3) - await result_3; - } - } try { - var env_5 = { stack: [], error: void 0, hasError: false }; - try { - var d23 = __addDisposableResource(env_5, (_f = {}, _f[Symbol.asyncDispose] = function () { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }, _f), true); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - var result_4 = __disposeResources(env_5); - if (result_4) - await result_4; - } - } - catch (_r) { - var env_6 = { stack: [], error: void 0, hasError: false }; - try { - var d24 = __addDisposableResource(env_6, (_g = {}, _g[Symbol.asyncDispose] = function () { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }, _g), true); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - var result_5 = __disposeResources(env_6); - if (result_5) - await result_5; - } - } - finally { - var env_7 = { stack: [], error: void 0, hasError: false }; - try { - var d25 = __addDisposableResource(env_7, (_h = {}, _h[Symbol.asyncDispose] = function () { - return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/]; - }); }); - }, _h), true); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - var result_6 = __disposeResources(env_7); - if (result_6) - await result_6; - } - } - if (true) { var env_8 = { stack: [], error: void 0, hasError: false }; try { - var d26 = __addDisposableResource(env_8, (_j = {}, _j[Symbol.asyncDispose] = function () { + var d25 = __addDisposableResource(env_8, (_h = {}, _h[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _j), true); + }, _h), true); } catch (e_7) { env_8.error = e_7; @@ -588,14 +594,14 @@ try { await result_7; } } - else { + catch (_t) { var env_9 = { stack: [], error: void 0, hasError: false }; try { - var d27 = __addDisposableResource(env_9, (_k = {}, _k[Symbol.asyncDispose] = function () { + var d26 = __addDisposableResource(env_9, (_j = {}, _j[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _k), true); + }, _j), true); } catch (e_8) { env_9.error = e_8; @@ -607,15 +613,14 @@ try { await result_8; } } - while (true) { + finally { var env_10 = { stack: [], error: void 0, hasError: false }; try { - var d28 = __addDisposableResource(env_10, (_l = {}, _l[Symbol.asyncDispose] = function () { + var d27 = __addDisposableResource(env_10, (_k = {}, _k[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _l), true); - break; + }, _k), true); } catch (e_9) { env_10.error = e_9; @@ -627,15 +632,14 @@ try { await result_9; } } - do { + if (true) { var env_11 = { stack: [], error: void 0, hasError: false }; try { - var d29 = __addDisposableResource(env_11, (_m = {}, _m[Symbol.asyncDispose] = function () { + var d28 = __addDisposableResource(env_11, (_l = {}, _l[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _m), true); - break; + }, _l), true); } catch (e_10) { env_11.error = e_10; @@ -646,16 +650,15 @@ try { if (result_10) await result_10; } - } while (true); - for (;;) { + } + else { var env_12 = { stack: [], error: void 0, hasError: false }; try { - var d30 = __addDisposableResource(env_12, (_o = {}, _o[Symbol.asyncDispose] = function () { + var d29 = __addDisposableResource(env_12, (_m = {}, _m[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _o), true); - break; + }, _m), true); } catch (e_11) { env_12.error = e_11; @@ -667,14 +670,15 @@ try { await result_11; } } - for (var x in {}) { + while (true) { var env_13 = { stack: [], error: void 0, hasError: false }; try { - var d31 = __addDisposableResource(env_13, (_p = {}, _p[Symbol.asyncDispose] = function () { + var d30 = __addDisposableResource(env_13, (_o = {}, _o[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _p), true); + }, _o), true); + break; } catch (e_12) { env_13.error = e_12; @@ -686,15 +690,15 @@ try { await result_12; } } - for (var _i = 0, _s = []; _i < _s.length; _i++) { - var x = _s[_i]; + do { var env_14 = { stack: [], error: void 0, hasError: false }; try { - var d32 = __addDisposableResource(env_14, (_q = {}, _q[Symbol.asyncDispose] = function () { + var d31 = __addDisposableResource(env_14, (_p = {}, _p[Symbol.asyncDispose] = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); - }, _q), true); + }, _p), true); + break; } catch (e_13) { env_14.error = e_13; @@ -705,15 +709,74 @@ try { if (result_13) await result_13; } + } while (true); + for (;;) { + var env_15 = { stack: [], error: void 0, hasError: false }; + try { + var d32 = __addDisposableResource(env_15, (_q = {}, _q[Symbol.asyncDispose] = function () { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }, _q), true); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + var result_14 = __disposeResources(env_15); + if (result_14) + await result_14; + } + } + for (var x in {}) { + var env_16 = { stack: [], error: void 0, hasError: false }; + try { + var d33 = __addDisposableResource(env_16, (_r = {}, _r[Symbol.asyncDispose] = function () { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }, _r), true); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + var result_15 = __disposeResources(env_16); + if (result_15) + await result_15; + } + } + for (var _i = 0, _u = []; _i < _u.length; _i++) { + var x = _u[_i]; + var env_17 = { stack: [], error: void 0, hasError: false }; + try { + var d34 = __addDisposableResource(env_17, (_s = {}, _s[Symbol.asyncDispose] = function () { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }, _s), true); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + var result_16 = __disposeResources(env_17); + if (result_16) + await result_16; + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - var result_14 = __disposeResources(env_2); - if (result_14) - await result_14; + var result_17 = __disposeResources(env_1); + if (result_17) + await result_17; } export {}; diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=esnext).js b/tests/baselines/reference/awaitUsingDeclarations.1(target=esnext).js index 66107e393d6f8..550568a4b2375 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=esnext).js +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=esnext).js @@ -40,61 +40,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; @@ -131,50 +142,59 @@ class C1 { await using d19 = { async [Symbol.asyncDispose]() { } }; } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() { } }; break; - case 1: + } + case 1: { await using d21 = { async [Symbol.asyncDispose]() { } }; break; + } + default: { + await using d22 = { async [Symbol.asyncDispose]() { } }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() { } }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() { } }; break; + } + default: { + await using d24 = { async [Symbol.asyncDispose]() { } }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() { } }; + await using d25 = { async [Symbol.asyncDispose]() { } }; } catch { - await using d24 = { async [Symbol.asyncDispose]() { } }; + await using d26 = { async [Symbol.asyncDispose]() { } }; } finally { - await using d25 = { async [Symbol.asyncDispose]() { } }; + await using d27 = { async [Symbol.asyncDispose]() { } }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() { } }; + await using d28 = { async [Symbol.asyncDispose]() { } }; } else { - await using d27 = { async [Symbol.asyncDispose]() { } }; + await using d29 = { async [Symbol.asyncDispose]() { } }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() { } }; + await using d30 = { async [Symbol.asyncDispose]() { } }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() { } }; + await using d31 = { async [Symbol.asyncDispose]() { } }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() { } }; + await using d32 = { async [Symbol.asyncDispose]() { } }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() { } }; + await using d33 = { async [Symbol.asyncDispose]() { } }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() { } }; + await using d34 = { async [Symbol.asyncDispose]() { } }; } export {}; diff --git a/tests/baselines/reference/awaitUsingDeclarations.17.errors.txt b/tests/baselines/reference/awaitUsingDeclarations.17.errors.txt new file mode 100644 index 0000000000000..945f3dad49be1 --- /dev/null +++ b/tests/baselines/reference/awaitUsingDeclarations.17.errors.txt @@ -0,0 +1,43 @@ +awaitUsingDeclarations.17.ts(3,9): error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +awaitUsingDeclarations.17.ts(7,9): error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +awaitUsingDeclarations.17.ts(11,9): error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +awaitUsingDeclarations.17.ts(17,13): error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +awaitUsingDeclarations.17.ts(21,13): error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + + +==== awaitUsingDeclarations.17.ts (5 errors) ==== + switch (Math.random()) { + case 0: + await using d20 = { async [Symbol.asyncDispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + case 1: + await using d21 = { async [Symbol.asyncDispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + default: + await using d22 = { async [Symbol.asyncDispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + } + + if (true) + switch (0) { + case 0: + await using d23 = { async [Symbol.asyncDispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + default: + await using d24 = { async [Symbol.asyncDispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1548: 'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + } + + export {}; + \ No newline at end of file diff --git a/tests/baselines/reference/awaitUsingDeclarations.17.js b/tests/baselines/reference/awaitUsingDeclarations.17.js new file mode 100644 index 0000000000000..bdaa4e0d63d79 --- /dev/null +++ b/tests/baselines/reference/awaitUsingDeclarations.17.js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.17.ts] //// + +//// [awaitUsingDeclarations.17.ts] +switch (Math.random()) { + case 0: + await using d20 = { async [Symbol.asyncDispose]() {} }; + break; + + case 1: + await using d21 = { async [Symbol.asyncDispose]() {} }; + break; + + default: + await using d22 = { async [Symbol.asyncDispose]() {} }; +} + +if (true) + switch (0) { + case 0: + await using d23 = { async [Symbol.asyncDispose]() {} }; + break; + + default: + await using d24 = { async [Symbol.asyncDispose]() {} }; + } + +export {}; + + +//// [awaitUsingDeclarations.17.js] +switch (Math.random()) { + case 0: + await using d20 = { async [Symbol.asyncDispose]() { } }; + break; + case 1: + await using d21 = { async [Symbol.asyncDispose]() { } }; + break; + default: + await using d22 = { async [Symbol.asyncDispose]() { } }; +} +if (true) + switch (0) { + case 0: + await using d23 = { async [Symbol.asyncDispose]() { } }; + break; + default: + await using d24 = { async [Symbol.asyncDispose]() { } }; + } +export {}; diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index 11b3093de6a53..c31195f2ad4d1 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -3,7 +3,7 @@ cannotInvokeNewOnErrorExpression.ts(5,22): error TS1011: An element access expre ==== cannotInvokeNewOnErrorExpression.ts (2 errors) ==== - module M + namespace M { class ClassA {} } diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js index 548c413fa674c..4b5346fbfad02 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts] //// //// [cannotInvokeNewOnErrorExpression.ts] -module M +namespace M { class ClassA {} } diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.symbols b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.symbols index 995b68c4cda61..ece816d502e3f 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.symbols +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts] //// === cannotInvokeNewOnErrorExpression.ts === -module M +namespace M >M : Symbol(M, Decl(cannotInvokeNewOnErrorExpression.ts, 0, 0)) { class ClassA {} diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.types b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.types index 1cfc2883866f0..3609269d95ff6 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.types +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts] //// === cannotInvokeNewOnErrorExpression.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/circularModuleImports.errors.txt b/tests/baselines/reference/circularModuleImports.errors.txt index d7fdcefcfdf47..55124d0dccf26 100644 --- a/tests/baselines/reference/circularModuleImports.errors.txt +++ b/tests/baselines/reference/circularModuleImports.errors.txt @@ -2,7 +2,7 @@ circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias ==== circularModuleImports.ts (1 errors) ==== - module M + namespace M { diff --git a/tests/baselines/reference/circularModuleImports.js b/tests/baselines/reference/circularModuleImports.js index 7457998dafa96..129feb9cbd247 100644 --- a/tests/baselines/reference/circularModuleImports.js +++ b/tests/baselines/reference/circularModuleImports.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/circularModuleImports.ts] //// //// [circularModuleImports.ts] -module M +namespace M { diff --git a/tests/baselines/reference/circularModuleImports.symbols b/tests/baselines/reference/circularModuleImports.symbols index c731f998229a4..7eb4444d06caf 100644 --- a/tests/baselines/reference/circularModuleImports.symbols +++ b/tests/baselines/reference/circularModuleImports.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/circularModuleImports.ts] //// === circularModuleImports.ts === -module M +namespace M >M : Symbol(M, Decl(circularModuleImports.ts, 0, 0)) { diff --git a/tests/baselines/reference/circularModuleImports.types b/tests/baselines/reference/circularModuleImports.types index a304a9e6d77fa..f50795d85d625 100644 --- a/tests/baselines/reference/circularModuleImports.types +++ b/tests/baselines/reference/circularModuleImports.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/circularModuleImports.ts] //// === circularModuleImports.ts === -module M +namespace M { diff --git a/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types b/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types index 29b958c768ad3..5aa7b5c308c6b 100644 --- a/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types +++ b/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types @@ -1,8 +1,5 @@ //// [tests/cases/compiler/circularlySimplifyingConditionalTypesNoCrash.ts] //// -=== Performance Stats === -Instantiation count: 1,000 - === circularlySimplifyingConditionalTypesNoCrash.ts === type Omit = Pick>; >Omit : Omit @@ -71,8 +68,8 @@ declare var connect: Connect; const myStoreConnect: Connect = function( >myStoreConnect : Connect > : ^^^^^^^ ->function( mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options: unknown = {},) { return connect( mapStateToProps, mapDispatchToProps, mergeProps, options, );} : (mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options?: unknown) => InferableComponentEnhancerWithProps> & TOwnProps> -> : ^ ^^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function( mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options: unknown = {},) { return connect( mapStateToProps, mapDispatchToProps, mergeProps, options, );} : (mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options?: unknown) => InferableComponentEnhancerWithProps> & TOwnProps> +> : ^ ^^^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mapStateToProps?: any, >mapStateToProps : any diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index 6be00dcf3fb7c..d7a29da097bae 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -1,6 +1,6 @@ first.js(23,9): error TS2554: Expected 1 arguments, but got 0. first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. - Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. + Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[] | undefined) => void'. Target signature provides too few arguments. Expected 2 or more, but got 1. first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. generic.js(19,19): error TS2554: Expected 1 arguments, but got 0. @@ -8,7 +8,7 @@ generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to second.ts(8,25): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. second.ts(14,7): error TS2417: Class static side 'typeof Conestoga' incorrectly extends base class static side 'typeof Wagon'. Types of property 'circle' are incompatible. - Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[]) => number'. + Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[] | undefined) => number'. Types of parameters 'others' and 'wagons' are incompatible. Type 'Wagon[]' is not assignable to type '(typeof Wagon)[]'. Property 'circle' is missing in type 'Wagon' but required in type 'typeof Wagon'. @@ -52,7 +52,7 @@ second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to p load(files, format) { ~~~~ !!! error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. -!!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. +!!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[] | undefined) => void'. !!! error TS2416: Target signature provides too few arguments. Expected 2 or more, but got 1. if (format === "xmlolololol") { throw new Error("please do not use XML. It was a joke."); @@ -95,7 +95,7 @@ second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to p ~~~~~~~~~ !!! error TS2417: Class static side 'typeof Conestoga' incorrectly extends base class static side 'typeof Wagon'. !!! error TS2417: Types of property 'circle' are incompatible. -!!! error TS2417: Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[]) => number'. +!!! error TS2417: Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[] | undefined) => number'. !!! error TS2417: Types of parameters 'others' and 'wagons' are incompatible. !!! error TS2417: Type 'Wagon[]' is not assignable to type '(typeof Wagon)[]'. !!! error TS2417: Property 'circle' is missing in type 'Wagon' but required in type 'typeof Wagon'. diff --git a/tests/baselines/reference/cloduleTest1.js b/tests/baselines/reference/cloduleTest1.js index a368d0f8b8ba4..5871181863b9a 100644 --- a/tests/baselines/reference/cloduleTest1.js +++ b/tests/baselines/reference/cloduleTest1.js @@ -5,7 +5,7 @@ interface $ { addClass(className: string): $; } - module $ { + namespace $ { export interface AjaxSettings { } export function ajax(options: AjaxSettings) { } diff --git a/tests/baselines/reference/cloduleTest1.symbols b/tests/baselines/reference/cloduleTest1.symbols index 10744b33a50b7..0ada382a6a5c4 100644 --- a/tests/baselines/reference/cloduleTest1.symbols +++ b/tests/baselines/reference/cloduleTest1.symbols @@ -14,16 +14,16 @@ >className : Symbol(className, Decl(cloduleTest1.ts, 2, 15)) >$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) } - module $ { + namespace $ { >$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) export interface AjaxSettings { ->AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 15)) } export function ajax(options: AjaxSettings) { } >ajax : Symbol(ajax, Decl(cloduleTest1.ts, 6, 5)) >options : Symbol(options, Decl(cloduleTest1.ts, 7, 25)) ->AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 15)) } var it: $ = $('.foo').addClass('bar'); >it : Symbol(it, Decl(cloduleTest1.ts, 9, 5)) diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index 30d56ceaeb475..c9976b2dfac3f 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -14,7 +14,7 @@ >className : string > : ^^^^^^ } - module $ { + namespace $ { >$ : typeof $ > : ^^^^^^^^ diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.js b/tests/baselines/reference/cloduleWithRecursiveReference.js index 06400b2629a9d..6a5e57b64b76f 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.js +++ b/tests/baselines/reference/cloduleWithRecursiveReference.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cloduleWithRecursiveReference.ts] //// //// [cloduleWithRecursiveReference.ts] -module M +namespace M { export class C { } export namespace C { diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.symbols b/tests/baselines/reference/cloduleWithRecursiveReference.symbols index ff0aae85cdbd1..08d99dc3d7224 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.symbols +++ b/tests/baselines/reference/cloduleWithRecursiveReference.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cloduleWithRecursiveReference.ts] //// === cloduleWithRecursiveReference.ts === -module M +namespace M >M : Symbol(M, Decl(cloduleWithRecursiveReference.ts, 0, 0)) { export class C { } diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.types b/tests/baselines/reference/cloduleWithRecursiveReference.types index 43ffa814195df..0f1a6b0b2343e 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.types +++ b/tests/baselines/reference/cloduleWithRecursiveReference.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/cloduleWithRecursiveReference.ts] //// === cloduleWithRecursiveReference.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt deleted file mode 100644 index b0d2957621fe2..0000000000000 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -collisionCodeGenModuleWithUnicodeNames.ts(6,13): error TS2304: Cannot find name '才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123'. - - -==== collisionCodeGenModuleWithUnicodeNames.ts (1 errors) ==== - namespace $1 { - export class 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { - } - } - - var x = new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123(); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name '才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123'. - - - \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js index 5de86203b13c0..93f03c1eeb785 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts] //// //// [collisionCodeGenModuleWithUnicodeNames.ts] -namespace $1 { +namespace 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { export class 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { } } @@ -12,13 +12,13 @@ var x = new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆ //// [collisionCodeGenModuleWithUnicodeNames.js] -var $1; -(function ($1) { +var 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123; +(function (才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123_1) { var 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 = /** @class */ (function () { function 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123() { } return 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123; }()); - $1.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 = 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123; -})($1 || ($1 = {})); + 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123_1.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 = 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123; +})(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 || (才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 = {})); var x = new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123(); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols index b3ac63b2e8110..ede74ab3e6f0d 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols @@ -1,16 +1,19 @@ //// [tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts] //// === collisionCodeGenModuleWithUnicodeNames.ts === -namespace $1 { ->$1 : Symbol($1, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) +namespace 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) export class 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { ->才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 14)) +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 85)) } } var x = new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123(); >x : Symbol(x, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 5, 3)) +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 85)) +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : Symbol(才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 85)) diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.types b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.types index f4788d6572885..e683d8f77f880 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.types @@ -1,9 +1,9 @@ //// [tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts] //// === collisionCodeGenModuleWithUnicodeNames.ts === -namespace $1 { ->$1 : typeof $1 -> : ^^^^^^^^^ +namespace 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : typeof globalThis.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ export class 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 { >才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 @@ -12,16 +12,16 @@ namespace $1 { } var x = new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123(); ->x : any -> : ^^^ ->new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123() : any -> : ^^^ ->才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : any -> : ^^^ ->才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : any -> : ^^^ ->才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : any -> : ^^^ +>x : 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123() : 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : typeof 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : typeof 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 : typeof 才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123.才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧß才čƒŊã‚ŊĐĢâ…¨č’¤éƒŗā¤°āĨā¤•āĨā¤ĄāĨā¤°ā¤žÃŧÄąÅŸÄŸÄ°liŲŠŲˆŲ†ŲŠŲƒŲˆØ¯ÃļÄÃŧßAbcd123 +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/ignoreConfig/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/ignoreConfig/tsconfig.json new file mode 100644 index 0000000000000..c9a9576660d4b --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/ignoreConfig/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "ignoreConfig": true + } +} diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.symbols b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.symbols new file mode 100644 index 0000000000000..5e148ae9c3a3a --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.symbols @@ -0,0 +1,89 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts] //// + +=== contextualParamTypeVsNestedReturnTypeInference1.ts === +interface Effect { +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 17)) + + _A: A; +>_A : Symbol(Effect._A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 21)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 17)) +} + +declare function effectGen(f: () => AEff): Effect; +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 2, 1)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) +>f : Symbol(f, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 33)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) + +declare function effectFn>( +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 62)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 26)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) + + body: (...args: Args) => unknown, +>body : Symbol(body, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 57)) +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 7, 9)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) + +): (...args: Args) => Effect; +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 4)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 26)) + +declare function layerEffect(tag: Tag, effect: Effect): unknown; +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 35)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) +>tag : Symbol(tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 32)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) +>effect : Symbol(effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 44)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) + +interface Tag { +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 14)) + + _Type: Type; +>_Type : Symbol(Tag._Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 21)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 14)) +} + +declare const Foo: Tag<{ +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 13)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) + + fn: (a: string) => unknown; +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 24)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 17, 7)) + +}>; + +layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 35)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 13)) + + effectGen(function () { +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 2, 1)) + + return { + fn: effectFn(function (a) { +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 23, 12)) +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 62)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 24, 29)) + + a; // string +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 24, 29)) + + }), + }; + }), +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.types b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.types new file mode 100644 index 0000000000000..578644d0ccd76 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference1.types @@ -0,0 +1,98 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts] //// + +=== contextualParamTypeVsNestedReturnTypeInference1.ts === +interface Effect { + _A: A; +>_A : A +> : ^ +} + +declare function effectGen(f: () => AEff): Effect; +>effectGen : (f: () => AEff) => Effect +> : ^ ^^ ^^ ^^^^^ +>f : () => AEff +> : ^^^^^^ + +declare function effectFn>( +>effectFn : >(body: (...args: Args) => unknown) => (...args: Args) => Effect +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + body: (...args: Args) => unknown, +>body : (...args: Args) => unknown +> : ^^^^ ^^ ^^^^^ +>args : Args +> : ^^^^ + +): (...args: Args) => Effect; +>args : Args +> : ^^^^ + +declare function layerEffect(tag: Tag, effect: Effect): unknown; +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^^^^ +>tag : Tag +> : ^^^^^^ +>effect : Effect +> : ^^^^^^^^^ + +interface Tag { + _Type: Type; +>_Type : Type +> : ^^^^ +} + +declare const Foo: Tag<{ +>Foo : Tag<{ fn: (a: string) => unknown; }> +> : ^^^^^^^^^^ ^^^^ + + fn: (a: string) => unknown; +>fn : (a: string) => unknown +> : ^ ^^ ^^^^^ +>a : string +> : ^^^^^^ + +}>; + +layerEffect( +>layerEffect( Foo, effectGen(function () { return { fn: effectFn(function (a) { a; // string }), }; }),) : unknown +> : ^^^^^^^ +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^^^^ + + Foo, +>Foo : Tag<{ fn: (a: string) => unknown; }> +> : ^^^^^^^^^^ ^^^^ + + effectGen(function () { +>effectGen(function () { return { fn: effectFn(function (a) { a; // string }), }; }) : Effect<{ fn: (a: string) => Effect; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectGen : (f: () => AEff) => Effect +> : ^ ^^ ^^ ^^^^^ +>function () { return { fn: effectFn(function (a) { a; // string }), }; } : () => { fn: (a: string) => Effect; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ fn: effectFn(function (a) { a; // string }), } : { fn: (a: string) => Effect; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + fn: effectFn(function (a) { +>fn : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn(function (a) { a; // string }) : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn : >(body: (...args: Args) => unknown) => (...args: Args) => Effect +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>function (a) { a; // string } : (a: string) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>a : string +> : ^^^^^^ + + a; // string +>a : string +> : ^^^^^^ + + }), + }; + }), +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.symbols b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.symbols new file mode 100644 index 0000000000000..ecd0513a72a74 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.symbols @@ -0,0 +1,273 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference2.ts] //// + +=== contextualParamTypeVsNestedReturnTypeInference2.ts === +type Covariant = (_: never) => A; +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 15)) +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 21)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 15)) + +interface Effect { +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 17)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 23)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 38)) + + readonly _A: Covariant; +>_A : Symbol(Effect._A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 55)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 17)) + + readonly _E: Covariant; +>_E : Symbol(Effect._E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 3, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 0)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 23)) + + readonly _R: Covariant; +>_R : Symbol(Effect._R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 4, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 0)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 2, 38)) +} + +declare function effectGen, AEff>( +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 6, 1)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 61)) + + f: () => Generator +>f : Symbol(f, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 68)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 61)) + +): Effect< +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 61)) + + [Eff] extends [never] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) + + ? never + : [Eff] extends [Effect] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 14, 33)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 14, 43)) +>_R : Symbol(_R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 14, 52)) + + ? E +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 14, 43)) + + : never, + [Eff] extends [never] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) + + ? never + : [Eff] extends [Effect] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 19, 33)) +>_E : Symbol(_E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 19, 43)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 19, 53)) + + ? R +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 19, 53)) + + : never +>; + +declare function effectFn< +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 22, 2)) + + Eff extends Effect, +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 25, 36)) + + Args extends Array +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 26, 7)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) + +>( + body: (...args: Args) => Generator +>body : Symbol(body, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 28, 2)) +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 29, 9)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 26, 7)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 25, 36)) + +): ( + ...args: Args +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 30, 4)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 26, 7)) + +) => Effect< +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 25, 36)) + + [Eff] extends [never] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) + + ? never + : [Eff] extends [Effect] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 36, 33)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 36, 43)) +>_R : Symbol(_R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 36, 52)) + + ? E +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 36, 43)) + + : never, + [Eff] extends [never] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) + + ? never + : [Eff] extends [Effect] +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 24, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 41, 33)) +>_E : Symbol(_E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 41, 43)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 41, 53)) + + ? R +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 41, 53)) + + : never +>; + +interface Tag { +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 65, 11), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 44, 2)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 46, 14)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 46, 24)) + + readonly _op: "Tag"; +>_op : Symbol(Tag._op, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 46, 40)) + + readonly Service: Value; +>Service : Symbol(Tag.Service, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 47, 22)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 46, 24)) + + readonly Identifier: Id; +>Identifier : Symbol(Tag.Identifier, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 48, 26)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 46, 14)) +} + +interface TagClassShape { +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 50, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 24), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 53, 23)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 27)) + + readonly Type: Shape; +>Type : Symbol(TagClassShape.Type, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 36)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 27)) + + readonly Id: Id; +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 24), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 53, 23)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 52, 24), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 53, 23)) +} + +interface TagClass extends Tag { +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 55, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 19)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 43)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 65, 11), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 44, 2)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 19)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 43)) + + new (_: never): TagClassShape; +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 58, 7)) +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 50, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 43)) + + readonly key: Id; +>key : Symbol(TagClass.key, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 58, 42)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 57, 24)) +} + +declare function layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 60, 1)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 37)) + + tag: Tag, +>tag : Symbol(tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 41)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 65, 11), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 44, 2)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 31)) + + effect: Effect +>effect : Symbol(effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 63, 17)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 62, 37)) + +): unknown; + +declare function Tag( +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 65, 11), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 44, 2)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 67, 21)) + + id: Id +>id : Symbol(id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 67, 46)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 67, 21)) + +): () => TagClass; +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 4)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 9)) +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 55, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 4)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 67, 21)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 9)) + +class Foo extends Tag("Foo")< +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 48)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 65, 11), Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 44, 2)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 48)) + { + fn: (a: string) => Effect; +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 73, 3)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 74, 9)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 0, 36)) + } +>() {} + +layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 60, 1)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 69, 48)) + + effectGen(function* () { +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 6, 1)) + + return { + fn: effectFn(function* (a) { +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 81, 12)) +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 22, 2)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 82, 30)) + + a; // string +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference2.ts, 82, 30)) + + }), + }; + }) +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.types b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.types new file mode 100644 index 0000000000000..ec3cb802a39c3 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference2.types @@ -0,0 +1,205 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference2.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== contextualParamTypeVsNestedReturnTypeInference2.ts === +type Covariant = (_: never) => A; +>Covariant : Covariant +> : ^^^^^^^^^^^^ +>_ : never +> : ^^^^^ + +interface Effect { + readonly _A: Covariant; +>_A : Covariant +> : ^^^^^^^^^^^^ + + readonly _E: Covariant; +>_E : Covariant +> : ^^^^^^^^^^^^ + + readonly _R: Covariant; +>_R : Covariant +> : ^^^^^^^^^^^^ +} + +declare function effectGen, AEff>( +>effectGen : , AEff>(f: () => Generator) => Effect] ? E : never, [Eff] extends [never] ? never : [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ + + f: () => Generator +>f : () => Generator +> : ^^^^^^ + +): Effect< + AEff, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? E + : never, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? R + : never +>; + +declare function effectFn< +>effectFn : , AEff, Args extends Array>(body: (...args: Args) => Generator) => (...args: Args) => Effect] ? E : never, [Eff] extends [never] ? never : [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + Eff extends Effect, + AEff, + Args extends Array +>( + body: (...args: Args) => Generator +>body : (...args: Args) => Generator +> : ^^^^ ^^ ^^^^^ +>args : Args +> : ^^^^ + +): ( + ...args: Args +>args : Args +> : ^^^^ + +) => Effect< + AEff, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? E + : never, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? R + : never +>; + +interface Tag { + readonly _op: "Tag"; +>_op : "Tag" +> : ^^^^^ + + readonly Service: Value; +>Service : Value +> : ^^^^^ + + readonly Identifier: Id; +>Identifier : Id +> : ^^ +} + +interface TagClassShape { + readonly Type: Shape; +>Type : Shape +> : ^^^^^ + + readonly Id: Id; +>Id : Id +> : ^^ +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; +>_ : never +> : ^^^^^ + + readonly key: Id; +>key : Id +> : ^^ +} + +declare function layerEffect( +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + tag: Tag, +>tag : Tag +> : ^^^^^^^^^ + + effect: Effect +>effect : Effect +> : ^^^^^^^^^^^^^^^ + +): unknown; + +declare function Tag( +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + id: Id +>id : Id +> : ^^ + +): () => TagClass; + +class Foo extends Tag("Foo")< +>Foo : Foo +> : ^^^ +>Tag("Foo")< Foo, { fn: (a: string) => Effect; }>() : TagClassShape<"Foo", { fn: (a: string) => Effect; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>Tag("Foo") : () => TagClass +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>"Foo" : "Foo" +> : ^^^^^ + + Foo, + { + fn: (a: string) => Effect; +>fn : (a: string) => Effect +> : ^ ^^ ^^^^^ +>a : string +> : ^^^^^^ + } +>() {} + +layerEffect( +>layerEffect( Foo, effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; })) : unknown +> : ^^^^^^^ +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + Foo, +>Foo : typeof Foo +> : ^^^^^^^^^^ + + effectGen(function* () { +>effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; }) : Effect<{ fn: (a: string) => Effect; }, never, never> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectGen : , AEff>(f: () => Generator) => Effect] ? E : never, [Eff] extends [never] ? never : [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +>function* () { return { fn: effectFn(function* (a) { a; // string }), }; } : () => Generator Effect; }, never> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ fn: effectFn(function* (a) { a; // string }), } : { fn: (a: string) => Effect; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + fn: effectFn(function* (a) { +>fn : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn(function* (a) { a; // string }) : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn : , AEff, Args extends Array>(body: (...args: Args) => Generator) => (...args: Args) => Effect] ? E : never, [Eff] extends [never] ? never : [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>function* (a) { a; // string } : (a: string) => Generator +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a : string +> : ^^^^^^ + + a; // string +>a : string +> : ^^^^^^ + + }), + }; + }) +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.symbols b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.symbols new file mode 100644 index 0000000000000..5d658092c0b65 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.symbols @@ -0,0 +1,245 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference3.ts] //// + +=== contextualParamTypeVsNestedReturnTypeInference3.ts === +type Covariant = (_: never) => A; +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 15)) +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 21)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 15)) + +interface Effect { +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 17)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 23)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 38)) + + readonly _A: Covariant; +>_A : Symbol(Effect._A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 55)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 17)) + + readonly _E: Covariant; +>_E : Symbol(Effect._E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 3, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 0)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 23)) + + readonly _R: Covariant; +>_R : Symbol(Effect._R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 4, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 0)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 2, 38)) +} + +declare function effectGen, AEff>( +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 6, 1)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 61)) + + f: () => Generator, +>f : Symbol(f, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 68)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 27)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 61)) + +): Effect< +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 61)) + + [Eff] extends [Effect] ? E : never, +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 12, 29)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 12, 39)) +>_R : Symbol(_R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 12, 48)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 12, 39)) + + [Eff] extends [Effect] ? R : never +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 8, 27)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 13, 29)) +>_E : Symbol(_E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 13, 39)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 13, 49)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 13, 49)) + +>; + +declare function effectFn< +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 14, 2)) + + Eff extends Effect, +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 16, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 17, 36)) + + Args extends Array, +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 18, 7)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) + +>( + body: (...args: Args) => Generator, +>body : Symbol(body, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 20, 2)) +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 21, 9)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 18, 7)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 16, 26)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 17, 36)) + +): ( + ...args: Args +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 22, 4)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 18, 7)) + +) => Effect< +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) + + AEff, +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 17, 36)) + + [Eff] extends [Effect] ? E : never, +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 16, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 26, 29)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 26, 39)) +>_R : Symbol(_R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 26, 48)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 26, 39)) + + [Eff] extends [Effect] ? R : never +>Eff : Symbol(Eff, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 16, 26)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>_A : Symbol(_A, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 27, 29)) +>_E : Symbol(_E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 27, 39)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 27, 49)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 27, 49)) + +>; + +interface Tag { +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 49, 11), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 28, 2)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 30, 14)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 30, 24)) + + readonly _op: "Tag"; +>_op : Symbol(Tag._op, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 30, 40)) + + readonly Service: Value; +>Service : Symbol(Tag.Service, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 31, 22)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 30, 24)) + + readonly Identifier: Id; +>Identifier : Symbol(Tag.Identifier, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 32, 26)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 30, 14)) +} + +interface TagClassShape { +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 34, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 24), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 37, 23)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 27)) + + readonly Type: Shape; +>Type : Symbol(TagClassShape.Type, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 36)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 27)) + + readonly Id: Id; +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 24), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 37, 23)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 36, 24), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 37, 23)) +} + +interface TagClass extends Tag { +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 39, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 19)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 43)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 49, 11), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 28, 2)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 19)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 43)) + + new (_: never): TagClassShape; +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 42, 7)) +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 34, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 43)) + + readonly key: Id; +>key : Symbol(TagClass.key, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 42, 42)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 41, 24)) +} + +declare function layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 44, 1)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 37)) + + tag: Tag, +>tag : Symbol(tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 41)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 49, 11), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 28, 2)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 31)) + + effect: Effect, +>effect : Symbol(effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 47, 17)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 46, 37)) + +): unknown; + +declare function Tag( +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 49, 11), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 28, 2)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 51, 21)) + + id: Id, +>id : Symbol(id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 51, 46)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 51, 21)) + +): () => TagClass; +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 4)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 9)) +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 39, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 4)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 51, 21)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 9)) + +class Foo extends Tag("Foo")< +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 48)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 49, 11), Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 28, 2)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 48)) + { + fn: (a: string) => Effect; +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 57, 3)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 58, 9)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 0, 36)) + } +>() {} + +layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 44, 1)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 53, 48)) + + effectGen(function* () { +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 6, 1)) + + return { + fn: effectFn(function* (a) { +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 65, 12)) +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 14, 2)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 66, 30)) + + a; // string +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference3.ts, 66, 30)) + + }), + }; + }), +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.types b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.types new file mode 100644 index 0000000000000..8bad76cb403aa --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference3.types @@ -0,0 +1,189 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference3.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== contextualParamTypeVsNestedReturnTypeInference3.ts === +type Covariant = (_: never) => A; +>Covariant : Covariant +> : ^^^^^^^^^^^^ +>_ : never +> : ^^^^^ + +interface Effect { + readonly _A: Covariant; +>_A : Covariant +> : ^^^^^^^^^^^^ + + readonly _E: Covariant; +>_E : Covariant +> : ^^^^^^^^^^^^ + + readonly _R: Covariant; +>_R : Covariant +> : ^^^^^^^^^^^^ +} + +declare function effectGen, AEff>( +>effectGen : , AEff>(f: () => Generator) => Effect] ? E : never, [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ + + f: () => Generator, +>f : () => Generator +> : ^^^^^^ + +): Effect< + AEff, + [Eff] extends [Effect] ? E : never, + [Eff] extends [Effect] ? R : never +>; + +declare function effectFn< +>effectFn : , AEff, Args extends Array>(body: (...args: Args) => Generator) => (...args: Args) => Effect] ? E : never, [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + Eff extends Effect, + AEff, + Args extends Array, +>( + body: (...args: Args) => Generator, +>body : (...args: Args) => Generator +> : ^^^^ ^^ ^^^^^ +>args : Args +> : ^^^^ + +): ( + ...args: Args +>args : Args +> : ^^^^ + +) => Effect< + AEff, + [Eff] extends [Effect] ? E : never, + [Eff] extends [Effect] ? R : never +>; + +interface Tag { + readonly _op: "Tag"; +>_op : "Tag" +> : ^^^^^ + + readonly Service: Value; +>Service : Value +> : ^^^^^ + + readonly Identifier: Id; +>Identifier : Id +> : ^^ +} + +interface TagClassShape { + readonly Type: Shape; +>Type : Shape +> : ^^^^^ + + readonly Id: Id; +>Id : Id +> : ^^ +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; +>_ : never +> : ^^^^^ + + readonly key: Id; +>key : Id +> : ^^ +} + +declare function layerEffect( +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + tag: Tag, +>tag : Tag +> : ^^^^^^^^^ + + effect: Effect, +>effect : Effect +> : ^^^^^^^^^^^^^^^ + +): unknown; + +declare function Tag( +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + id: Id, +>id : Id +> : ^^ + +): () => TagClass; + +class Foo extends Tag("Foo")< +>Foo : Foo +> : ^^^ +>Tag("Foo")< Foo, { fn: (a: string) => Effect; }>() : TagClassShape<"Foo", { fn: (a: string) => Effect; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>Tag("Foo") : () => TagClass +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>"Foo" : "Foo" +> : ^^^^^ + + Foo, + { + fn: (a: string) => Effect; +>fn : (a: string) => Effect +> : ^ ^^ ^^^^^ +>a : string +> : ^^^^^^ + } +>() {} + +layerEffect( +>layerEffect( Foo, effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; }),) : unknown +> : ^^^^^^^ +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + Foo, +>Foo : typeof Foo +> : ^^^^^^^^^^ + + effectGen(function* () { +>effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; }) : Effect<{ fn: (a: string) => Effect; }, unknown, unknown> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectGen : , AEff>(f: () => Generator) => Effect] ? E : never, [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +>function* () { return { fn: effectFn(function* (a) { a; // string }), }; } : () => Generator Effect; }, never> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ fn: effectFn(function* (a) { a; // string }), } : { fn: (a: string) => Effect; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + fn: effectFn(function* (a) { +>fn : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn(function* (a) { a; // string }) : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn : , AEff, Args extends Array>(body: (...args: Args) => Generator) => (...args: Args) => Effect] ? E : never, [Eff] extends [Effect] ? R : never> +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>function* (a) { a; // string } : (a: string) => Generator +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a : string +> : ^^^^^^ + + a; // string +>a : string +> : ^^^^^^ + + }), + }; + }), +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.symbols b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.symbols new file mode 100644 index 0000000000000..47c49da15fbf1 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.symbols @@ -0,0 +1,207 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference4.ts] //// + +=== contextualParamTypeVsNestedReturnTypeInference4.ts === +type Covariant = (_: never) => A; +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 15)) +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 21)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 15)) + +interface Effect { +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 17)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 23)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 38)) + + readonly _A: Covariant; +>_A : Symbol(Effect._A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 55)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 0)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 17)) + + readonly _E: Covariant; +>_E : Symbol(Effect._E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 3, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 0)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 23)) + + readonly _R: Covariant; +>_R : Symbol(Effect._R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 4, 28)) +>Covariant : Symbol(Covariant, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 0)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 2, 38)) +} + +declare function effectGen( +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 6, 1)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 27)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 29)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 32)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 35)) + + f: () => Generator, AEff, never>, +>f : Symbol(f, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 42)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 27)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 29)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 32)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 35)) + +): Effect; +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 35)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 29)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 8, 32)) + +declare function effectFn>( +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 10, 22)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 26)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 28)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 31)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 34)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 40)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) + + body: (...args: Args) => Generator, AEff, never>, +>body : Symbol(body, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 66)) +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 13, 9)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 40)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 26)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 28)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 31)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 34)) + +): (...args: Args) => Effect; +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 4)) +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 40)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 34)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 28)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 12, 31)) + +interface Tag { +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 35, 11), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 41)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 16, 14)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 16, 24)) + + readonly _op: "Tag"; +>_op : Symbol(Tag._op, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 16, 40)) + + readonly Service: Value; +>Service : Symbol(Tag.Service, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 17, 22)) +>Value : Symbol(Value, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 16, 24)) + + readonly Identifier: Id; +>Identifier : Symbol(Tag.Identifier, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 18, 26)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 16, 14)) +} + +interface TagClassShape { +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 20, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 24), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 23, 23)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 27)) + + readonly Type: Shape; +>Type : Symbol(TagClassShape.Type, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 36)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 27)) + + readonly Id: Id; +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 24), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 23, 23)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 22, 24), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 23, 23)) +} + +interface TagClass extends Tag { +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 25, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 19)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 43)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 35, 11), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 41)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 19)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 43)) + + new (_: never): TagClassShape; +>_ : Symbol(_, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 28, 7)) +>TagClassShape : Symbol(TagClassShape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 20, 1)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 24)) +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 43)) + + readonly key: Id; +>key : Symbol(TagClass.key, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 28, 42)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 27, 24)) +} + +declare function layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 30, 1)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 37)) + + tag: Tag, +>tag : Symbol(tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 41)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 35, 11), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 41)) +>I : Symbol(I, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 29)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 31)) + + effect: Effect, +>effect : Symbol(effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 33, 17)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 31)) +>E : Symbol(E, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 34)) +>R : Symbol(R, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 32, 37)) + +): unknown; + +declare function Tag( +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 35, 11), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 41)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 37, 21)) + + id: Id, +>id : Symbol(id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 37, 46)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 37, 21)) + +): () => TagClass; +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 4)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 9)) +>TagClass : Symbol(TagClass, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 25, 1)) +>Self : Symbol(Self, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 4)) +>Id : Symbol(Id, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 37, 21)) +>Shape : Symbol(Shape, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 9)) + +class Foo extends Tag("Foo")< +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 48)) +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 35, 11), Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 14, 41)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 48)) + { + fn: (a: string) => Effect; +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 43, 3)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 44, 9)) +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 0, 36)) + } +>() {} + +layerEffect( +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 30, 1)) + + Foo, +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 39, 48)) + + effectGen(function* () { +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 6, 1)) + + return { + fn: effectFn(function* (a) { +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 51, 12)) +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 10, 22)) +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 52, 30)) + + a; // string +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference4.ts, 52, 30)) + + }), + }; + }), +); + diff --git a/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.types b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.types new file mode 100644 index 0000000000000..b898b6a68fc34 --- /dev/null +++ b/tests/baselines/reference/contextualParamTypeVsNestedReturnTypeInference4.types @@ -0,0 +1,174 @@ +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference4.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== contextualParamTypeVsNestedReturnTypeInference4.ts === +type Covariant = (_: never) => A; +>Covariant : Covariant +> : ^^^^^^^^^^^^ +>_ : never +> : ^^^^^ + +interface Effect { + readonly _A: Covariant; +>_A : Covariant +> : ^^^^^^^^^^^^ + + readonly _E: Covariant; +>_E : Covariant +> : ^^^^^^^^^^^^ + + readonly _R: Covariant; +>_R : Covariant +> : ^^^^^^^^^^^^ +} + +declare function effectGen( +>effectGen : (f: () => Generator, AEff, never>) => Effect +> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + f: () => Generator, AEff, never>, +>f : () => Generator, AEff, never> +> : ^^^^^^ + +): Effect; + +declare function effectFn>( +>effectFn : >(body: (...args: Args) => Generator, AEff, never>) => (...args: Args) => Effect +> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + body: (...args: Args) => Generator, AEff, never>, +>body : (...args: Args) => Generator, AEff, never> +> : ^^^^ ^^ ^^^^^ +>args : Args +> : ^^^^ + +): (...args: Args) => Effect; +>args : Args +> : ^^^^ + +interface Tag { + readonly _op: "Tag"; +>_op : "Tag" +> : ^^^^^ + + readonly Service: Value; +>Service : Value +> : ^^^^^ + + readonly Identifier: Id; +>Identifier : Id +> : ^^ +} + +interface TagClassShape { + readonly Type: Shape; +>Type : Shape +> : ^^^^^ + + readonly Id: Id; +>Id : Id +> : ^^ +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; +>_ : never +> : ^^^^^ + + readonly key: Id; +>key : Id +> : ^^ +} + +declare function layerEffect( +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + tag: Tag, +>tag : Tag +> : ^^^^^^^^^ + + effect: Effect, +>effect : Effect +> : ^^^^^^^^^^^^^^^ + +): unknown; + +declare function Tag( +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + id: Id, +>id : Id +> : ^^ + +): () => TagClass; + +class Foo extends Tag("Foo")< +>Foo : Foo +> : ^^^ +>Tag("Foo")< Foo, { fn: (a: string) => Effect; }>() : TagClassShape<"Foo", { fn: (a: string) => Effect; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>Tag("Foo") : () => TagClass +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tag : (id: Id) => () => TagClass +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>"Foo" : "Foo" +> : ^^^^^ + + Foo, + { + fn: (a: string) => Effect; +>fn : (a: string) => Effect +> : ^ ^^ ^^^^^ +>a : string +> : ^^^^^^ + } +>() {} + +layerEffect( +>layerEffect( Foo, effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; }),) : unknown +> : ^^^^^^^ +>layerEffect : (tag: Tag, effect: Effect) => unknown +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ + + Foo, +>Foo : typeof Foo +> : ^^^^^^^^^^ + + effectGen(function* () { +>effectGen(function* () { return { fn: effectFn(function* (a) { a; // string }), }; }) : Effect<{ fn: (a: string) => Effect; }, unknown, unknown> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectGen : (f: () => Generator, AEff, never>) => Effect +> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ +>function* () { return { fn: effectFn(function* (a) { a; // string }), }; } : () => Generator Effect; }, never> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ fn: effectFn(function* (a) { a; // string }), } : { fn: (a: string) => Effect; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + fn: effectFn(function* (a) { +>fn : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn(function* (a) { a; // string }) : (a: string) => Effect +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>effectFn : >(body: (...args: Args) => Generator, AEff, never>) => (...args: Args) => Effect +> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>function* (a) { a; // string } : (a: string) => Generator +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a : string +> : ^^^^^^ + + a; // string +>a : string +> : ^^^^^^ + + }), + }; + }), +); + diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index d0e1ec59137fc..81ddd799f0b1e 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/declareDottedExtend.ts] //// //// [declareDottedExtend.ts] -declare module A.B +declare namespace A.B { export class C{ } } diff --git a/tests/baselines/reference/declareDottedExtend.symbols b/tests/baselines/reference/declareDottedExtend.symbols index 48cb9e6a3db1d..01c8539a08d93 100644 --- a/tests/baselines/reference/declareDottedExtend.symbols +++ b/tests/baselines/reference/declareDottedExtend.symbols @@ -1,9 +1,9 @@ //// [tests/cases/compiler/declareDottedExtend.ts] //// === declareDottedExtend.ts === -declare module A.B +declare namespace A.B >A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) ->B : Symbol(B, Decl(declareDottedExtend.ts, 0, 17)) +>B : Symbol(B, Decl(declareDottedExtend.ts, 0, 20)) { export class C{ } >C : Symbol(C, Decl(declareDottedExtend.ts, 1, 1)) @@ -12,7 +12,7 @@ declare module A.B import ab = A.B; >ab : Symbol(ab, Decl(declareDottedExtend.ts, 3, 1)) >A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) ->B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 20)) class D extends ab.C{ } >D : Symbol(D, Decl(declareDottedExtend.ts, 5, 16)) @@ -23,8 +23,8 @@ class D extends ab.C{ } class E extends A.B.C{ } >E : Symbol(E, Decl(declareDottedExtend.ts, 7, 23)) >A.B.C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) ->A.B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>A.B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 20)) >A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) ->B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 20)) >C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) diff --git a/tests/baselines/reference/declareDottedExtend.types b/tests/baselines/reference/declareDottedExtend.types index ffd3fc1c33a93..c057d1664edf8 100644 --- a/tests/baselines/reference/declareDottedExtend.types +++ b/tests/baselines/reference/declareDottedExtend.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/declareDottedExtend.ts] //// === declareDottedExtend.ts === -declare module A.B +declare namespace A.B >A : typeof A > : ^^^^^^^^ >B : typeof B diff --git a/tests/baselines/reference/dottedModuleName2.js b/tests/baselines/reference/dottedModuleName2.js index 4586e6a17c54a..65c4e4cccf4c5 100644 --- a/tests/baselines/reference/dottedModuleName2.js +++ b/tests/baselines/reference/dottedModuleName2.js @@ -22,7 +22,7 @@ var tmpOK = AA.B.x; var tmpError = A.B.x; -module A.B.C +namespace A.B.C { @@ -32,7 +32,7 @@ module A.B.C -module M +namespace M { diff --git a/tests/baselines/reference/dottedModuleName2.symbols b/tests/baselines/reference/dottedModuleName2.symbols index 3f176241d0f60..2512b81402601 100644 --- a/tests/baselines/reference/dottedModuleName2.symbols +++ b/tests/baselines/reference/dottedModuleName2.symbols @@ -3,7 +3,7 @@ === dottedModuleName2.ts === namespace A.B { >A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) ->B : Symbol(B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) export var x = 1; >x : Symbol(x, Decl(dottedModuleName2.ts, 2, 12)) @@ -34,16 +34,16 @@ var tmpOK = AA.B.x; var tmpError = A.B.x; >tmpError : Symbol(tmpError, Decl(dottedModuleName2.ts, 18, 3)) >A.B.x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) ->A.B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) +>A.B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) >A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) ->B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) +>B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) >x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) -module A.B.C +namespace A.B.C >A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) ->B : Symbol(B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) ->C : Symbol(C, Decl(dottedModuleName2.ts, 21, 11)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) +>C : Symbol(C, Decl(dottedModuleName2.ts, 21, 14)) { @@ -54,7 +54,7 @@ module A.B.C -module M +namespace M >M : Symbol(M, Decl(dottedModuleName2.ts, 27, 1)) { @@ -66,13 +66,13 @@ module M import X2 = A.B; >X2 : Symbol(X2, Decl(dottedModuleName2.ts, 35, 18)) >A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) ->B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) import X3 = A.B.C; >X3 : Symbol(X3, Decl(dottedModuleName2.ts, 37, 20)) >A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) ->B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 9)) ->C : Symbol(X2.C, Decl(dottedModuleName2.ts, 21, 11)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 12), Decl(dottedModuleName2.ts, 21, 12)) +>C : Symbol(X2.C, Decl(dottedModuleName2.ts, 21, 14)) } diff --git a/tests/baselines/reference/dottedModuleName2.types b/tests/baselines/reference/dottedModuleName2.types index cd7ec8d5de88f..13430275a7181 100644 --- a/tests/baselines/reference/dottedModuleName2.types +++ b/tests/baselines/reference/dottedModuleName2.types @@ -62,7 +62,7 @@ var tmpError = A.B.x; > : ^^^^^^ -module A.B.C +namespace A.B.C >A : typeof A > : ^^^^^^^^ >B : typeof B @@ -82,7 +82,7 @@ module A.B.C -module M +namespace M { diff --git a/tests/baselines/reference/escapedIdentifiers.errors.txt b/tests/baselines/reference/escapedIdentifiers.errors.txt new file mode 100644 index 0000000000000..c1c08718cd21f --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.errors.txt @@ -0,0 +1,125 @@ +escapedIdentifiers.ts(25,16): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + + +==== escapedIdentifiers.ts (1 errors) ==== + /* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za + */ + + // var decl + var \u0061 = 1; + a ++; + \u0061 ++; + + var b = 1; + b ++; + \u0062 ++; + + // modules + namespace moduleType1 { + export var baz1: number; + } + declare module moduleType\u0032 { + ~~~~~~~~~~~~~~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + export var baz2: number; + } + + moduleType1.baz1 = 3; + moduleType\u0031.baz1 = 3; + moduleType2.baz2 = 3; + moduleType\u0032.baz2 = 3; + + // classes + + class classType1 { + public foo1: number; + } + class classType\u0032 { + public foo2: number; + } + + var classType1Object1 = new classType1(); + classType1Object1.foo1 = 2; + var classType1Object2 = new classType\u0031(); + classType1Object2.foo1 = 2; + var classType2Object1 = new classType2(); + classType2Object1.foo2 = 2; + var classType2Object2 = new classType\u0032(); + classType2Object2.foo2 = 2; + + // interfaces + interface interfaceType1 { + bar1: number; + } + interface interfaceType\u0032 { + bar2: number; + } + + var interfaceType1Object1 = { bar1: 0 }; + interfaceType1Object1.bar1 = 2; + var interfaceType1Object2 = { bar1: 0 }; + interfaceType1Object2.bar1 = 2; + var interfaceType2Object1 = { bar2: 0 }; + interfaceType2Object1.bar2 = 2; + var interfaceType2Object2 = { bar2: 0 }; + interfaceType2Object2.bar2 = 2; + + + // arguments + class testClass { + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { + arg\u0031 = 1; + arg2 = 'string'; + arg\u0033 = true; + arg4 = 2; + } + } + + // constructors + class constructorTestClass { + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { + } + } + var constructorTestObject = new constructorTestClass(1, 'string', true, 2); + constructorTestObject.arg\u0031 = 1; + constructorTestObject.arg2 = 'string'; + constructorTestObject.arg\u0033 = true; + constructorTestObject.arg4 = 2; + + // Lables + + l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + + label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + + label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + + l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } \ No newline at end of file diff --git a/tests/baselines/reference/escapedIdentifiers.js b/tests/baselines/reference/escapedIdentifiers.js index f6d19e5ede628..308e0b40db6af 100644 --- a/tests/baselines/reference/escapedIdentifiers.js +++ b/tests/baselines/reference/escapedIdentifiers.js @@ -25,7 +25,7 @@ b ++; namespace moduleType1 { export var baz1: number; } -module moduleType\u0032 { +declare module moduleType\u0032 { export var baz2: number; } @@ -143,9 +143,6 @@ b++; var moduleType1; (function (moduleType1) { })(moduleType1 || (moduleType1 = {})); -var moduleType\u0032; -(function (moduleType\u0032) { -})(moduleType\u0032 || (moduleType\u0032 = {})); moduleType1.baz1 = 3; moduleType\u0031.baz1 = 3; moduleType2.baz2 = 3; diff --git a/tests/baselines/reference/escapedIdentifiers.symbols b/tests/baselines/reference/escapedIdentifiers.symbols index 762f7898cfd30..acefacf43c13e 100644 --- a/tests/baselines/reference/escapedIdentifiers.symbols +++ b/tests/baselines/reference/escapedIdentifiers.symbols @@ -38,7 +38,7 @@ namespace moduleType1 { export var baz1: number; >baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 22, 14)) } -module moduleType\u0032 { +declare module moduleType\u0032 { >moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) export var baz2: number; diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index 9cd78aad95682..1dc9de2b70a31 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -58,7 +58,7 @@ namespace moduleType1 { >baz1 : number > : ^^^^^^ } -module moduleType\u0032 { +declare module moduleType\u0032 { >moduleType\u0032 : typeof moduleType\u0032 > : ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/functionInIfStatementInModule.js b/tests/baselines/reference/functionInIfStatementInModule.js index f5f25cc9cdb8c..6afcd6efe7c85 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.js +++ b/tests/baselines/reference/functionInIfStatementInModule.js @@ -2,7 +2,7 @@ //// [functionInIfStatementInModule.ts] -module Midori +namespace Midori { if (false) { function Foo(src) diff --git a/tests/baselines/reference/functionInIfStatementInModule.symbols b/tests/baselines/reference/functionInIfStatementInModule.symbols index 96c71570b6914..923b9c0e1ca65 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.symbols +++ b/tests/baselines/reference/functionInIfStatementInModule.symbols @@ -2,7 +2,7 @@ === functionInIfStatementInModule.ts === -module Midori +namespace Midori >Midori : Symbol(Midori, Decl(functionInIfStatementInModule.ts, 0, 0)) { if (false) { diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 0c2ff67fcbeb0..9910aac2655c6 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -2,7 +2,7 @@ === functionInIfStatementInModule.ts === -module Midori +namespace Midori >Midori : typeof Midori > : ^^^^^^^^^^^^^ { diff --git a/tests/baselines/reference/generatorTypeCheck62.types b/tests/baselines/reference/generatorTypeCheck62.types index 6196ace757ddb..0a4b1e599cf2e 100644 --- a/tests/baselines/reference/generatorTypeCheck62.types +++ b/tests/baselines/reference/generatorTypeCheck62.types @@ -117,8 +117,8 @@ export const Nothing2: Strategy = strategy("Nothing", function*(state: St export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { >Nothing3 : Strategy > : ^^^^^^^^^^^^^^^ ->strategy("Nothing", function* (state: State) { yield ; return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.}) : (a: State) => IterableIterator -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>strategy("Nothing", function* (state: State) { yield ; return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.}) : (a: any) => IterableIterator +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator > : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ >"Nothing" : "Nothing" diff --git a/tests/baselines/reference/generatorTypeCheck64.symbols b/tests/baselines/reference/generatorTypeCheck64.symbols new file mode 100644 index 0000000000000..dd0656f99f5e8 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck64.symbols @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck64.ts] //// + +=== generatorTypeCheck64.ts === +function* g3(): Generator number>> { +>g3 : Symbol(g3, Decl(generatorTypeCheck64.ts, 0, 0)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 0, 37)) + + yield function* () { + yield x => x.length; +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 2, 13)) +>x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 2, 13)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) + + } () +} + +function* g4(): Iterator number>> { +>g4 : Symbol(g4, Decl(generatorTypeCheck64.ts, 4, 1)) +>Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.esnext.iterator.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 6, 35)) + + yield (function* () { + yield (x) => x.length; +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 8, 11)) +>x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(generatorTypeCheck64.ts, 8, 11)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) + + })(); +} + diff --git a/tests/baselines/reference/generatorTypeCheck64.types b/tests/baselines/reference/generatorTypeCheck64.types new file mode 100644 index 0000000000000..3bcc3d4917712 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck64.types @@ -0,0 +1,67 @@ +//// [tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck64.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== generatorTypeCheck64.ts === +function* g3(): Generator number>> { +>g3 : () => Generator number>> +> : ^^^^^^ +>x : string +> : ^^^^^^ + + yield function* () { +>yield function* () { yield x => x.length; } () : any +>function* () { yield x => x.length; } () : Generator<(x: string) => number, void, any> +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function* () { yield x => x.length; } : () => Generator<(x: string) => number, void, any> +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + yield x => x.length; +>yield x => x.length : any +>x => x.length : (x: string) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>x : string +> : ^^^^^^ +>x.length : number +> : ^^^^^^ +>x : string +> : ^^^^^^ +>length : number +> : ^^^^^^ + + } () +} + +function* g4(): Iterator number>> { +>g4 : () => Iterator number>> +> : ^^^^^^ +>x : string +> : ^^^^^^ + + yield (function* () { +>yield (function* () { yield (x) => x.length; })() : any +>(function* () { yield (x) => x.length; })() : Generator<(x: string) => number, void, any> +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(function* () { yield (x) => x.length; }) : () => Generator<(x: string) => number, void, any> +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function* () { yield (x) => x.length; } : () => Generator<(x: string) => number, void, any> +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + yield (x) => x.length; +>yield (x) => x.length : any +>(x) => x.length : (x: string) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>x : string +> : ^^^^^^ +>x.length : number +> : ^^^^^^ +>x : string +> : ^^^^^^ +>length : number +> : ^^^^^^ + + })(); +} + diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.errors.txt b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.errors.txt index 2e11850567bc4..004bb0a139971 100644 --- a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.errors.txt +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.errors.txt @@ -1,7 +1,21 @@ genericCallAtYieldExpressionInGenericCall1.ts(26,25): error TS2488: Type '() => T' must have a '[Symbol.iterator]()' method that returns an iterator. +genericCallAtYieldExpressionInGenericCall1.ts(56,8): error TS2345: Argument of type '(value: T) => Generator' is not assignable to parameter of type '(value: unknown) => Generator'. + Call signature return types 'Generator' and 'Generator' are incompatible. + The types returned by 'next(...)' are incompatible between these types. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'number' is not assignable to type 'never'. +genericCallAtYieldExpressionInGenericCall1.ts(61,8): error TS2345: Argument of type '(value: T) => Generator' is not assignable to parameter of type '(value: unknown) => Generator'. + Call signature return types 'Generator' and 'Generator' are incompatible. + The types returned by 'next(...)' are incompatible between these types. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'number' is not assignable to type 'never'. -==== genericCallAtYieldExpressionInGenericCall1.ts (1 errors) ==== +==== genericCallAtYieldExpressionInGenericCall1.ts (3 errors) ==== declare const inner: { (value: A): { (): A; @@ -31,4 +45,57 @@ genericCallAtYieldExpressionInGenericCall1.ts(26,25): error TS2488: Type '() => ~~~~~~~~~~~~~ !!! error TS2488: Type '() => T' must have a '[Symbol.iterator]()' method that returns an iterator. }); + + declare const inner3: { + (value: A): { + (): A; + [Symbol.iterator](): { + next(...args: ReadonlyArray): IteratorResult; + }; + }; + }; + + declare function outer2(body: (value: A) => Generator): Y; + + // number + const result1 = outer2(function* (value: T) { + yield* inner3(value); + }); + + // number + const result2 = outer2(function* (value: T) { + const x = inner3(value); + yield* x; + }); + + declare function outer3( + body: (value: A) => Generator, + ): void; + + // error + outer3(function* (value: T) { + ~~~~~~~~ +!!! error TS2345: Argument of type '(value: T) => Generator' is not assignable to parameter of type '(value: unknown) => Generator'. +!!! error TS2345: Call signature return types 'Generator' and 'Generator' are incompatible. +!!! error TS2345: The types returned by 'next(...)' are incompatible between these types. +!!! error TS2345: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2345: Type 'number' is not assignable to type 'never'. + yield* inner3(value); + }); + + // error + outer3(function* (value: T) { + ~~~~~~~~ +!!! error TS2345: Argument of type '(value: T) => Generator' is not assignable to parameter of type '(value: unknown) => Generator'. +!!! error TS2345: Call signature return types 'Generator' and 'Generator' are incompatible. +!!! error TS2345: The types returned by 'next(...)' are incompatible between these types. +!!! error TS2345: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2345: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2345: Type 'number' is not assignable to type 'never'. + const x = inner3(value); + yield* x; + }); \ No newline at end of file diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.symbols b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.symbols index cb6dca78b13bf..544989df3125f 100644 --- a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.symbols +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.symbols @@ -91,3 +91,116 @@ outer(function* (value: T) { }); +declare const inner3: { +>inner3 : Symbol(inner3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 28, 13)) + + (value: A): { +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 29, 3)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 29, 6)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 29, 3)) + + (): A; +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 29, 3)) + + [Symbol.iterator](): { +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(genericCallAtYieldExpressionInGenericCall1.ts, 30, 10)) +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) + + next(...args: ReadonlyArray): IteratorResult; +>next : Symbol(next, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 31, 26)) +>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 32, 11)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 3 more) +>IteratorResult : Symbol(IteratorResult, Decl(lib.es2015.iterable.d.ts, --, --)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 29, 3)) + + }; + }; +}; + +declare function outer2(body: (value: A) => Generator): Y; +>outer2 : Symbol(outer2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 35, 2)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 24)) +>Y : Symbol(Y, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 26)) +>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 30)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 37)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 24)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Y : Symbol(Y, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 26)) +>Y : Symbol(Y, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 37, 26)) + +// number +const result1 = outer2(function* (value: T) { +>result1 : Symbol(result1, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 40, 5)) +>outer2 : Symbol(outer2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 35, 2)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 40, 34)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 40, 37)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 40, 34)) + + yield* inner3(value); +>inner3 : Symbol(inner3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 28, 13)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 40, 37)) + +}); + +// number +const result2 = outer2(function* (value: T) { +>result2 : Symbol(result2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 45, 5)) +>outer2 : Symbol(outer2, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 35, 2)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 45, 34)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 45, 37)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 45, 34)) + + const x = inner3(value); +>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 46, 7)) +>inner3 : Symbol(inner3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 28, 13)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 45, 37)) + + yield* x; +>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 46, 7)) + +}); + +declare function outer3( +>outer3 : Symbol(outer3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 48, 3)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 50, 24)) + + body: (value: A) => Generator, +>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 50, 27)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 51, 9)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 50, 24)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) + +): void; + +// error +outer3(function* (value: T) { +>outer3 : Symbol(outer3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 48, 3)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 55, 18)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 55, 21)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 55, 18)) + + yield* inner3(value); +>inner3 : Symbol(inner3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 28, 13)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 55, 21)) + +}); + +// error +outer3(function* (value: T) { +>outer3 : Symbol(outer3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 48, 3)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 60, 18)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 60, 21)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 60, 18)) + + const x = inner3(value); +>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 61, 7)) +>inner3 : Symbol(inner3, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 28, 13)) +>value : Symbol(value, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 60, 21)) + + yield* x; +>x : Symbol(x, Decl(genericCallAtYieldExpressionInGenericCall1.ts, 61, 7)) + +}); + diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.types b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.types index e0b92b3ccd070..176caa68de2e3 100644 --- a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.types +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.types @@ -47,8 +47,8 @@ outer(function* (value: T) { > : ^^^^ >outer : (body: (value: A) => Generator) => void > : ^ ^^ ^^ ^^^^^ ->function* (value: T) { const result = yield* inner(value); // ok} : (value: T) => Generator -> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function* (value: T) { const result = yield* inner(value); // ok} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : T > : ^ @@ -111,8 +111,8 @@ outer(function* (value: T) { > : ^^^^ >outer : (body: (value: A) => Generator) => void > : ^ ^^ ^^ ^^^^^ ->function* (value: T) { const result = yield* inner2(value); // error} : (value: T) => Generator -> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function* (value: T) { const result = yield* inner2(value); // error} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : T > : ^ @@ -130,3 +130,160 @@ outer(function* (value: T) { }); +declare const inner3: { +>inner3 : (value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^ ^^ ^^ ^^^^^ + + (value: A): { +>value : A +> : ^ + + (): A; + [Symbol.iterator](): { +>[Symbol.iterator] : () => { next(...args: ReadonlyArray): IteratorResult; } +> : ^^^^^^ +>Symbol.iterator : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol : SymbolConstructor +> : ^^^^^^^^^^^^^^^^^ +>iterator : unique symbol +> : ^^^^^^^^^^^^^ + + next(...args: ReadonlyArray): IteratorResult; +>next : (...args: ReadonlyArray) => IteratorResult +> : ^^^^ ^^ ^^^^^ +>args : readonly any[] +> : ^^^^^^^^^^^^^^ + + }; + }; +}; + +declare function outer2(body: (value: A) => Generator): Y; +>outer2 : (body: (value: A) => Generator) => Y +> : ^ ^^ ^^ ^^ ^^^^^ +>body : (value: A) => Generator +> : ^ ^^ ^^^^^ +>value : A +> : ^ + +// number +const result1 = outer2(function* (value: T) { +>result1 : number +> : ^^^^^^ +>outer2(function* (value: T) { yield* inner3(value);}) : number +> : ^^^^^^ +>outer2 : (body: (value: A) => Generator) => Y +> : ^ ^^ ^^ ^^ ^^^^^ +>function* (value: T) { yield* inner3(value);} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : T +> : ^ + + yield* inner3(value); +>yield* inner3(value) : T +> : ^ +>inner3(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3 : (value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^ ^^ ^^ ^^^^^ +>value : T +> : ^ + +}); + +// number +const result2 = outer2(function* (value: T) { +>result2 : number +> : ^^^^^^ +>outer2(function* (value: T) { const x = inner3(value); yield* x;}) : number +> : ^^^^^^ +>outer2 : (body: (value: A) => Generator) => Y +> : ^ ^^ ^^ ^^ ^^^^^ +>function* (value: T) { const x = inner3(value); yield* x;} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : T +> : ^ + + const x = inner3(value); +>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3 : (value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^ ^^ ^^ ^^^^^ +>value : T +> : ^ + + yield* x; +>yield* x : T +> : ^ +>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}); + +declare function outer3( +>outer3 : (body: (value: A) => Generator) => void +> : ^ ^^ ^^ ^^^^^ + + body: (value: A) => Generator, +>body : (value: A) => Generator +> : ^ ^^ ^^^^^ +>value : A +> : ^ + +): void; + +// error +outer3(function* (value: T) { +>outer3(function* (value: T) { yield* inner3(value);}) : void +> : ^^^^ +>outer3 : (body: (value: A) => Generator) => void +> : ^ ^^ ^^ ^^^^^ +>function* (value: T) { yield* inner3(value);} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : T +> : ^ + + yield* inner3(value); +>yield* inner3(value) : T +> : ^ +>inner3(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3 : (value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^ ^^ ^^ ^^^^^ +>value : T +> : ^ + +}); + +// error +outer3(function* (value: T) { +>outer3(function* (value: T) { const x = inner3(value); yield* x;}) : void +> : ^^^^ +>outer3 : (body: (value: A) => Generator) => void +> : ^ ^^ ^^ ^^^^^ +>function* (value: T) { const x = inner3(value); yield* x;} : (value: T) => Generator +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : T +> : ^ + + const x = inner3(value); +>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3(value) : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inner3 : (value: A) => { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^ ^^ ^^ ^^^^^ +>value : T +> : ^ + + yield* x; +>yield* x : T +> : ^ +>x : { (): T; [Symbol.iterator](): { next(...args: ReadonlyArray): IteratorResult; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}); + diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall2.types b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall2.types index 35d2c2809705b..d4968b29a3cac 100644 --- a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall2.types +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall2.types @@ -70,8 +70,8 @@ fn(function* (queue: Enqueue, value: T) { > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >fn : >(body: (...args: Args) => Generator) => (...args: Args) => any > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ->function* (queue: Enqueue, value: T) { yield* offer(queue, value);} : (queue: Enqueue, value: T) => Generator -> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function* (queue: Enqueue, value: T) { yield* offer(queue, value);} : (queue: Enqueue, value: T) => Generator +> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >queue : Enqueue > : ^^^^^^^^^^ >value : T diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.symbols b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.symbols new file mode 100644 index 0000000000000..d3772db880ab9 --- /dev/null +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.symbols @@ -0,0 +1,181 @@ +//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts] //// + +=== genericCallAtYieldExpressionInGenericCall3.ts === +type ReadonlyRecord = { +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) +>K : Symbol(K, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 20)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 53)) + + readonly [P in K]: A; +>P : Symbol(P, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 1, 12)) +>K : Symbol(K, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 20)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 53)) + +}; + +type Success = T extends Micro ? _A : never; +>Success : Symbol(Success, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 2, 2)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 13)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 13)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>_A : Symbol(_A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 39)) +>_E : Symbol(_E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 49)) +>_R : Symbol(_R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 59)) +>_A : Symbol(_A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 39)) + +interface MicroIterator> { +>MicroIterator : Symbol(MicroIterator, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 77)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) + + next(...args: ReadonlyArray): IteratorResult>; +>next : Symbol(MicroIterator.next, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 57)) +>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 7, 7)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 3 more) +>IteratorResult : Symbol(IteratorResult, Decl(lib.es2015.iterable.d.ts, --, --)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) +>Success : Symbol(Success, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 2, 2)) +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) +} + +interface Micro { +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) + + _A: A; +>_A : Symbol(Micro._A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 54)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) + + _E: E; +>_E : Symbol(Micro._E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 11, 8)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) + + _R: R; +>_R : Symbol(Micro._R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 12, 8)) +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) + + [Symbol.iterator](): MicroIterator>; +>[Symbol.iterator] : Symbol(Micro[Symbol.iterator], Decl(genericCallAtYieldExpressionInGenericCall3.ts, 13, 8)) +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>MicroIterator : Symbol(MicroIterator, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 77)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) +} + +declare function runPromise(effect: Micro): Promise; +>runPromise : Symbol(runPromise, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 15, 1)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 30)) +>effect : Symbol(effect, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 34)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 30)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) + +declare function gen, AEff>( +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) +>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 21)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) + + body: () => Generator, +>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 61)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 21)) +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) + +): Micro; +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) + +declare const traverse: { +>traverse : Symbol(traverse, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 23, 13)) + + ( +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 5)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) + + f: (a: A) => Micro, +>f : Symbol(f, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 18)) +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 25, 8)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) + + ): ( + self: ReadonlyRecord, +>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 26, 6)) +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) + + ) => Micro, E, O>; +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) + + ( +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) + + self: ReadonlyRecord, +>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 15)) +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) + + f: (a: A) => Micro, +>f : Symbol(f, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 30, 36)) +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 31, 8)) +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) + + ): Micro, E, O>; +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) + +}; + +runPromise( +>runPromise : Symbol(runPromise, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 15, 1)) + + gen(function* () { +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) + + yield* traverse({ a: 1, b: 2 }, (n) => +>traverse : Symbol(traverse, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 23, 13)) +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 21)) +>b : Symbol(b, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 27)) +>n : Symbol(n, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 37)) + + gen(function* () { +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) + + return n + 1; +>n : Symbol(n, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 37)) + + }), + ); + }), +); + diff --git a/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.types b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.types new file mode 100644 index 0000000000000..6888c696198b1 --- /dev/null +++ b/tests/baselines/reference/genericCallAtYieldExpressionInGenericCall3.types @@ -0,0 +1,154 @@ +//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== genericCallAtYieldExpressionInGenericCall3.ts === +type ReadonlyRecord = { +>ReadonlyRecord : ReadonlyRecord +> : ^^^^^^^^^^^^^^^^^^^^ + + readonly [P in K]: A; +}; + +type Success = T extends Micro ? _A : never; +>Success : Success +> : ^^^^^^^^^^ + +interface MicroIterator> { + next(...args: ReadonlyArray): IteratorResult>; +>next : (...args: ReadonlyArray) => IteratorResult> +> : ^^^^ ^^ ^^^^^ +>args : readonly any[] +> : ^^^^^^^^^^^^^^ +} + +interface Micro { + _A: A; +>_A : A +> : ^ + + _E: E; +>_E : E +> : ^ + + _R: R; +>_R : R +> : ^ + + [Symbol.iterator](): MicroIterator>; +>[Symbol.iterator] : () => MicroIterator> +> : ^^^^^^ +>Symbol.iterator : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol : SymbolConstructor +> : ^^^^^^^^^^^^^^^^^ +>iterator : unique symbol +> : ^^^^^^^^^^^^^ +} + +declare function runPromise(effect: Micro): Promise; +>runPromise : (effect: Micro) => Promise +> : ^ ^^ ^^ ^^ ^^^^^ +>effect : Micro +> : ^^^^^^^^^^^^^^^^^^ + +declare function gen, AEff>( +>gen : , AEff>(body: () => Generator) => Micro +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ + + body: () => Generator, +>body : () => Generator +> : ^^^^^^ + +): Micro; + +declare const traverse: { +>traverse : { (f: (a: A) => Micro): (self: ReadonlyRecord) => Micro, E, O>; (self: ReadonlyRecord, f: (a: A) => Micro): Micro, E, O>; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ + + ( + f: (a: A) => Micro, +>f : (a: A) => Micro +> : ^ ^^ ^^^^^ +>a : A +> : ^ + + ): ( + self: ReadonlyRecord, +>self : ReadonlyRecord +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + ) => Micro, E, O>; + ( + self: ReadonlyRecord, +>self : ReadonlyRecord +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + + f: (a: A) => Micro, +>f : (a: A) => Micro +> : ^ ^^ ^^^^^ +>a : A +> : ^ + + ): Micro, E, O>; +}; + +runPromise( +>runPromise( gen(function* () { yield* traverse({ a: 1, b: 2 }, (n) => gen(function* () { return n + 1; }), ); }),) : Promise +> : ^^^^^^^^^^^^^ +>runPromise : (effect: Micro) => Promise +> : ^ ^^ ^^ ^^ ^^^^^ + + gen(function* () { +>gen(function* () { yield* traverse({ a: 1, b: 2 }, (n) => gen(function* () { return n + 1; }), ); }) : Micro +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>gen : , AEff>(body: () => Generator) => Micro +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +>function* () { yield* traverse({ a: 1, b: 2 }, (n) => gen(function* () { return n + 1; }), ); } : () => Generator, any, never>, void, any> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + yield* traverse({ a: 1, b: 2 }, (n) => +>yield* traverse({ a: 1, b: 2 }, (n) => gen(function* () { return n + 1; }), ) : ReadonlyRecord +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>traverse({ a: 1, b: 2 }, (n) => gen(function* () { return n + 1; }), ) : Micro, any, never> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>traverse : { (f: (a: A) => Micro): (self: ReadonlyRecord) => Micro, E, O>; (self: ReadonlyRecord, f: (a: A) => Micro): Micro, E, O>; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ +>{ a: 1, b: 2 } : { a: number; b: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>a : number +> : ^^^^^^ +>1 : 1 +> : ^ +>b : number +> : ^^^^^^ +>2 : 2 +> : ^ +>(n) => gen(function* () { return n + 1; }) : (n: number) => Micro +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>n : number +> : ^^^^^^ + + gen(function* () { +>gen(function* () { return n + 1; }) : Micro +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>gen : , AEff>(body: () => Generator) => Micro +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +>function* () { return n + 1; } : () => Generator +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return n + 1; +>n + 1 : number +> : ^^^^^^ +>n : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }), + ); + }), +); + diff --git a/tests/baselines/reference/goToDefinitionObjectLiteralProperties2.baseline.jsonc b/tests/baselines/reference/goToDefinitionObjectLiteralProperties2.baseline.jsonc new file mode 100644 index 0000000000000..b2e4ae4010978 --- /dev/null +++ b/tests/baselines/reference/goToDefinitionObjectLiteralProperties2.baseline.jsonc @@ -0,0 +1,154 @@ +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts === +// type C = { +// <|[|foo|]: string;|> +// bar: number; +// }; +// +// declare function fn(arg: T): T; +// +// fn({ +// foo/*GOTO DEF*/: "", +// bar: true, +// }); +// +// --- (line: 13) skipped --- + + // === Details === + [ + { + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] + + + +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts === +// type C = { +// foo: string; +// <|[|bar|]: number;|> +// }; +// +// declare function fn(arg: T): T; +// +// fn({ +// foo: "", +// bar/*GOTO DEF*/: true, +// }); +// +// const result = fn({ +// --- (line: 14) skipped --- + + // === Details === + [ + { + "kind": "property", + "name": "bar", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] + + + +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts === +// type C = { +// <|[|foo|]: string;|> +// bar: number; +// }; +// +// --- (line: 6) skipped --- + +// --- (line: 10) skipped --- +// }); +// +// const result = fn({ +// foo/*GOTO DEF*/: "", +// bar: 1, +// }); +// +// // this one shouldn't go to the constraint type +// result.foo; + + // === Details === + [ + { + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] + + + +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts === +// type C = { +// foo: string; +// <|[|bar|]: number;|> +// }; +// +// declare function fn(arg: T): T; +// --- (line: 7) skipped --- + +// --- (line: 11) skipped --- +// +// const result = fn({ +// foo: "", +// bar/*GOTO DEF*/: 1, +// }); +// +// // this one shouldn't go to the constraint type +// result.foo; + + // === Details === + [ + { + "kind": "property", + "name": "bar", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] + + + +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts === +// --- (line: 10) skipped --- +// }); +// +// const result = fn({ +// <|[|foo|]: ""|>, +// bar: 1, +// }); +// +// // this one shouldn't go to the constraint type +// result.foo/*GOTO DEF*/; + + // === Details === + [ + { + "kind": "property", + "name": "foo", + "containerName": "__object", + "isLocal": false, + "isAmbient": false, + "unverified": false, + "failedAliasResolution": false + } + ] \ No newline at end of file diff --git a/tests/baselines/reference/goToDefinitionObjectLiteralProperties3.baseline.jsonc b/tests/baselines/reference/goToDefinitionObjectLiteralProperties3.baseline.jsonc new file mode 100644 index 0000000000000..dbf44ed9bfe20 --- /dev/null +++ b/tests/baselines/reference/goToDefinitionObjectLiteralProperties3.baseline.jsonc @@ -0,0 +1,85 @@ +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties3.ts === +// type A = { +// <|[|{| defId: 0 |}foo|]: unknown;|> +// }; +// +// type B = { +// <|[|{| defId: 1 |}foo|]?: unknown;|> +// bar: unknown; +// }; +// +// function test1(arg: A | B) {} +// +// test1({ +// foo/*GOTO DEF*/: 1, +// }); +// +// function test2(arg: T | B) {} +// --- (line: 17) skipped --- + + // === Details === + [ + { + "defId": 0, + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + }, + { + "defId": 1, + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] + + + +// === goToDefinition === +// === /tests/cases/fourslash/goToDefinitionObjectLiteralProperties3.ts === +// type A = { +// <|[|{| defId: 0 |}foo|]: unknown;|> +// }; +// +// type B = { +// <|[|{| defId: 1 |}foo|]?: unknown;|> +// bar: unknown; +// }; +// +// --- (line: 10) skipped --- + +// --- (line: 15) skipped --- +// function test2(arg: T | B) {} +// +// test2({ +// foo/*GOTO DEF*/: 2, +// }); + + // === Details === + [ + { + "defId": 0, + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + }, + { + "defId": 1, + "kind": "property", + "name": "foo", + "containerName": "__type", + "isLocal": false, + "isAmbient": false, + "unverified": false + } + ] \ No newline at end of file diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion1.symbols b/tests/baselines/reference/inferenceContextualReturnTypeUnion1.symbols new file mode 100644 index 0000000000000..552f8a7d1f2b9 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion1.symbols @@ -0,0 +1,53 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion1.ts] //// + +=== inferenceContextualReturnTypeUnion1.ts === +// https://github.com/microsoft/TypeScript/issues/50719 + +declare function useCallback1(fn: T): T; +>useCallback1 : Symbol(useCallback1, Decl(inferenceContextualReturnTypeUnion1.ts, 0, 0)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 30)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>fn : Symbol(fn, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 50)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 30)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 30)) + +declare function ex2(callback?: (x: number) => void): void; +>ex2 : Symbol(ex2, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 60)) +>callback : Symbol(callback, Decl(inferenceContextualReturnTypeUnion1.ts, 4, 21)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 4, 33)) + +ex2(useCallback1((x) => {})); +>ex2 : Symbol(ex2, Decl(inferenceContextualReturnTypeUnion1.ts, 2, 60)) +>useCallback1 : Symbol(useCallback1, Decl(inferenceContextualReturnTypeUnion1.ts, 0, 0)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 5, 18)) + +declare function ex3(callback: ((x: number) => void) | 5): void; +>ex3 : Symbol(ex3, Decl(inferenceContextualReturnTypeUnion1.ts, 5, 29)) +>callback : Symbol(callback, Decl(inferenceContextualReturnTypeUnion1.ts, 7, 21)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 7, 33)) + +ex3(useCallback1((x) => {})); +>ex3 : Symbol(ex3, Decl(inferenceContextualReturnTypeUnion1.ts, 5, 29)) +>useCallback1 : Symbol(useCallback1, Decl(inferenceContextualReturnTypeUnion1.ts, 0, 0)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 8, 18)) + +// https://github.com/microsoft/TypeScript/issues/41461 + +declare function useCallback2 any>( +>useCallback2 : Symbol(useCallback2, Decl(inferenceContextualReturnTypeUnion1.ts, 8, 29)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 12, 30)) +>args : Symbol(args, Decl(inferenceContextualReturnTypeUnion1.ts, 12, 41)) + + callback: T, +>callback : Symbol(callback, Decl(inferenceContextualReturnTypeUnion1.ts, 12, 65)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 12, 30)) + +): T; +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion1.ts, 12, 30)) + +const test: ((x: string) => void) | undefined = useCallback2((x) => {}); +>test : Symbol(test, Decl(inferenceContextualReturnTypeUnion1.ts, 15, 5)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 15, 14)) +>useCallback2 : Symbol(useCallback2, Decl(inferenceContextualReturnTypeUnion1.ts, 8, 29)) +>x : Symbol(x, Decl(inferenceContextualReturnTypeUnion1.ts, 15, 62)) + diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion1.types b/tests/baselines/reference/inferenceContextualReturnTypeUnion1.types new file mode 100644 index 0000000000000..fd85d18736427 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion1.types @@ -0,0 +1,82 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion1.ts] //// + +=== inferenceContextualReturnTypeUnion1.ts === +// https://github.com/microsoft/TypeScript/issues/50719 + +declare function useCallback1(fn: T): T; +>useCallback1 : (fn: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>fn : T +> : ^ + +declare function ex2(callback?: (x: number) => void): void; +>ex2 : (callback?: (x: number) => void) => void +> : ^ ^^^ ^^^^^ +>callback : ((x: number) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ +>x : number +> : ^^^^^^ + +ex2(useCallback1((x) => {})); +>ex2(useCallback1((x) => {})) : void +> : ^^^^ +>ex2 : (callback?: (x: number) => void) => void +> : ^ ^^^ ^^^^^ +>useCallback1((x) => {}) : (x: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>useCallback1 : (fn: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(x) => {} : (x: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>x : number +> : ^^^^^^ + +declare function ex3(callback: ((x: number) => void) | 5): void; +>ex3 : (callback: ((x: number) => void) | 5) => void +> : ^ ^^ ^^^^^ +>callback : ((x: number) => void) | 5 +> : ^^ ^^ ^^^^^ ^^^^^ +>x : number +> : ^^^^^^ + +ex3(useCallback1((x) => {})); +>ex3(useCallback1((x) => {})) : void +> : ^^^^ +>ex3 : (callback: ((x: number) => void) | 5) => void +> : ^ ^^ ^^^^^ +>useCallback1((x) => {}) : (x: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>useCallback1 : (fn: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(x) => {} : (x: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>x : number +> : ^^^^^^ + +// https://github.com/microsoft/TypeScript/issues/41461 + +declare function useCallback2 any>( +>useCallback2 : any>(callback: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>args : any[] +> : ^^^^^ + + callback: T, +>callback : T +> : ^ + +): T; +const test: ((x: string) => void) | undefined = useCallback2((x) => {}); +>test : ((x: string) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ +>x : string +> : ^^^^^^ +>useCallback2((x) => {}) : (x: string) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>useCallback2 : any>(callback: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(x) => {} : (x: string) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>x : string +> : ^^^^^^ + diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion2.symbols b/tests/baselines/reference/inferenceContextualReturnTypeUnion2.symbols new file mode 100644 index 0000000000000..d46672fb09211 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion2.symbols @@ -0,0 +1,97 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion2.ts] //// + +=== inferenceContextualReturnTypeUnion2.ts === +type Query = ( +>Query : Symbol(Query, Decl(inferenceContextualReturnTypeUnion2.ts, 0, 0)) + + container: HTMLElement, +>container : Symbol(container, Decl(inferenceContextualReturnTypeUnion2.ts, 0, 14)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + ...args: any[] +>args : Symbol(args, Decl(inferenceContextualReturnTypeUnion2.ts, 1, 25)) + +) => + | Error +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) + + | HTMLElement +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + | HTMLElement[] +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + | Promise +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + | Promise +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + | null; + +interface Queries { +>Queries : Symbol(Queries, Decl(inferenceContextualReturnTypeUnion2.ts, 9, 9)) + + [T: string]: Query; +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 12, 3)) +>Query : Symbol(Query, Decl(inferenceContextualReturnTypeUnion2.ts, 0, 0)) +} + +type FindByText = ( +>FindByText : Symbol(FindByText, Decl(inferenceContextualReturnTypeUnion2.ts, 13, 1)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 15, 16)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + container: HTMLElement, +>container : Symbol(container, Decl(inferenceContextualReturnTypeUnion2.ts, 15, 56)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + text: string, +>text : Symbol(text, Decl(inferenceContextualReturnTypeUnion2.ts, 16, 25)) + +) => Promise; +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 15, 16)) + +declare function findByLabelText( +>findByLabelText : Symbol(findByLabelText, Decl(inferenceContextualReturnTypeUnion2.ts, 18, 16)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 20, 33)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + ...args: Parameters> +>args : Symbol(args, Decl(inferenceContextualReturnTypeUnion2.ts, 20, 70)) +>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) +>FindByText : Symbol(FindByText, Decl(inferenceContextualReturnTypeUnion2.ts, 13, 1)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 20, 33)) + +): ReturnType>; +>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) +>FindByText : Symbol(FindByText, Decl(inferenceContextualReturnTypeUnion2.ts, 13, 1)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion2.ts, 20, 33)) + +const queries = { +>queries : Symbol(queries, Decl(inferenceContextualReturnTypeUnion2.ts, 24, 5)) + + findByLabelText, +>findByLabelText : Symbol(findByLabelText, Decl(inferenceContextualReturnTypeUnion2.ts, 24, 17)) + +}; + +type MapQueries = { +>MapQueries : Symbol(MapQueries, Decl(inferenceContextualReturnTypeUnion2.ts, 26, 2)) +>Q : Symbol(Q, Decl(inferenceContextualReturnTypeUnion2.ts, 28, 16)) +>Queries : Symbol(Queries, Decl(inferenceContextualReturnTypeUnion2.ts, 9, 9)) +>queries : Symbol(queries, Decl(inferenceContextualReturnTypeUnion2.ts, 24, 5)) + + [P in keyof Q]: Q[P]; +>P : Symbol(P, Decl(inferenceContextualReturnTypeUnion2.ts, 29, 3)) +>Q : Symbol(Q, Decl(inferenceContextualReturnTypeUnion2.ts, 28, 16)) +>Q : Symbol(Q, Decl(inferenceContextualReturnTypeUnion2.ts, 28, 16)) +>P : Symbol(P, Decl(inferenceContextualReturnTypeUnion2.ts, 29, 3)) + +}; + diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion2.types b/tests/baselines/reference/inferenceContextualReturnTypeUnion2.types new file mode 100644 index 0000000000000..4464c94ddeae0 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion2.types @@ -0,0 +1,74 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion2.ts] //// + +=== inferenceContextualReturnTypeUnion2.ts === +type Query = ( +>Query : Query +> : ^^^^^ + + container: HTMLElement, +>container : HTMLElement +> : ^^^^^^^^^^^ + + ...args: any[] +>args : any[] +> : ^^^^^ + +) => + | Error + | HTMLElement + | HTMLElement[] + | Promise + | Promise + | null; + +interface Queries { + [T: string]: Query; +>T : string +> : ^^^^^^ +} + +type FindByText = ( +>FindByText : FindByText +> : ^^^^^^^^^^^^^ + + container: HTMLElement, +>container : HTMLElement +> : ^^^^^^^^^^^ + + text: string, +>text : string +> : ^^^^^^ + +) => Promise; + +declare function findByLabelText( +>findByLabelText : (container: HTMLElement, text: string) => ReturnType> +> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ...args: Parameters> +>args : [container: HTMLElement, text: string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +): ReturnType>; + +const queries = { +>queries : { findByLabelText: (container: HTMLElement, text: string) => ReturnType>; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>{ findByLabelText,} : { findByLabelText: (container: HTMLElement, text: string) => ReturnType>; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ + + findByLabelText, +>findByLabelText : (container: HTMLElement, text: string) => ReturnType> +> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}; + +type MapQueries = { +>MapQueries : MapQueries +> : ^^^^^^^^^^^^^ +>queries : { findByLabelText: (container: HTMLElement, text: string) => ReturnType>; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ + + [P in keyof Q]: Q[P]; +}; + diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion3.symbols b/tests/baselines/reference/inferenceContextualReturnTypeUnion3.symbols new file mode 100644 index 0000000000000..43c94f2219b10 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion3.symbols @@ -0,0 +1,146 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion3.ts] //// + +=== inferenceContextualReturnTypeUnion3.ts === +declare function deprecate( +>deprecate : Symbol(deprecate, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 0)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 27)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.decorators.d.ts, --, --)) + + fn: T, +>fn : Symbol(fn, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 47)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 27)) + + msg: string, +>msg : Symbol(msg, Decl(inferenceContextualReturnTypeUnion3.ts, 1, 8)) + + code?: string, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 2, 14)) + +): T; +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 27)) + +const soonFrozenObjectDeprecation = ( +>soonFrozenObjectDeprecation : Symbol(soonFrozenObjectDeprecation, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 5)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 37)) + + obj: T, +>obj : Symbol(obj, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 55)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 37)) + + name: string, +>name : Symbol(name, Decl(inferenceContextualReturnTypeUnion3.ts, 7, 9)) + + code: string, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 8, 15)) + + note = "", +>note : Symbol(note, Decl(inferenceContextualReturnTypeUnion3.ts, 9, 15)) + +): T => { +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 37)) + + const message = `${name} will be frozen in future, all modifications are deprecated.${ +>message : Symbol(message, Decl(inferenceContextualReturnTypeUnion3.ts, 12, 7)) +>name : Symbol(name, Decl(inferenceContextualReturnTypeUnion3.ts, 7, 9)) + + note && `\n${note}` +>note : Symbol(note, Decl(inferenceContextualReturnTypeUnion3.ts, 9, 15)) +>note : Symbol(note, Decl(inferenceContextualReturnTypeUnion3.ts, 9, 15)) + + }`; + return new Proxy(obj, { +>Proxy : Symbol(Proxy, Decl(lib.es2015.proxy.d.ts, --, --)) +>obj : Symbol(obj, Decl(inferenceContextualReturnTypeUnion3.ts, 6, 55)) + + set: deprecate( +>set : Symbol(set, Decl(inferenceContextualReturnTypeUnion3.ts, 15, 25)) +>deprecate : Symbol(deprecate, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 0)) + + (target, property, value, receiver) => +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 14)) +>value : Symbol(value, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 24)) +>receiver : Symbol(receiver, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 31)) + + Reflect.set(target, property, value, receiver), +>Reflect.set : Symbol(Reflect.set, Decl(lib.es2015.reflect.d.ts, --, --), Decl(lib.es2015.reflect.d.ts, --, --)) +>Reflect : Symbol(Reflect, Decl(lib.es2015.reflect.d.ts, --, --)) +>set : Symbol(Reflect.set, Decl(lib.es2015.reflect.d.ts, --, --), Decl(lib.es2015.reflect.d.ts, --, --)) +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 14)) +>value : Symbol(value, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 24)) +>receiver : Symbol(receiver, Decl(inferenceContextualReturnTypeUnion3.ts, 17, 31)) + + message, +>message : Symbol(message, Decl(inferenceContextualReturnTypeUnion3.ts, 12, 7)) + + code, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 8, 15)) + + ), + defineProperty: deprecate( +>defineProperty : Symbol(defineProperty, Decl(inferenceContextualReturnTypeUnion3.ts, 21, 6)) +>deprecate : Symbol(deprecate, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 0)) + + (target, property, descriptor) => +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 14)) +>descriptor : Symbol(descriptor, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 24)) + + Reflect.defineProperty(target, property, descriptor), +>Reflect.defineProperty : Symbol(Reflect.defineProperty, Decl(lib.es2015.reflect.d.ts, --, --)) +>Reflect : Symbol(Reflect, Decl(lib.es2015.reflect.d.ts, --, --)) +>defineProperty : Symbol(Reflect.defineProperty, Decl(lib.es2015.reflect.d.ts, --, --)) +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 14)) +>descriptor : Symbol(descriptor, Decl(inferenceContextualReturnTypeUnion3.ts, 23, 24)) + + message, +>message : Symbol(message, Decl(inferenceContextualReturnTypeUnion3.ts, 12, 7)) + + code, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 8, 15)) + + ), + deleteProperty: deprecate( +>deleteProperty : Symbol(deleteProperty, Decl(inferenceContextualReturnTypeUnion3.ts, 27, 6)) +>deprecate : Symbol(deprecate, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 0)) + + (target, property) => Reflect.deleteProperty(target, property), +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 29, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 29, 14)) +>Reflect.deleteProperty : Symbol(Reflect.deleteProperty, Decl(lib.es2015.reflect.d.ts, --, --)) +>Reflect : Symbol(Reflect, Decl(lib.es2015.reflect.d.ts, --, --)) +>deleteProperty : Symbol(Reflect.deleteProperty, Decl(lib.es2015.reflect.d.ts, --, --)) +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 29, 7)) +>property : Symbol(property, Decl(inferenceContextualReturnTypeUnion3.ts, 29, 14)) + + message, +>message : Symbol(message, Decl(inferenceContextualReturnTypeUnion3.ts, 12, 7)) + + code, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 8, 15)) + + ), + setPrototypeOf: deprecate( +>setPrototypeOf : Symbol(setPrototypeOf, Decl(inferenceContextualReturnTypeUnion3.ts, 32, 6)) +>deprecate : Symbol(deprecate, Decl(inferenceContextualReturnTypeUnion3.ts, 0, 0)) + + (target, proto) => Reflect.setPrototypeOf(target, proto), +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 34, 7)) +>proto : Symbol(proto, Decl(inferenceContextualReturnTypeUnion3.ts, 34, 14)) +>Reflect.setPrototypeOf : Symbol(Reflect.setPrototypeOf, Decl(lib.es2015.reflect.d.ts, --, --)) +>Reflect : Symbol(Reflect, Decl(lib.es2015.reflect.d.ts, --, --)) +>setPrototypeOf : Symbol(Reflect.setPrototypeOf, Decl(lib.es2015.reflect.d.ts, --, --)) +>target : Symbol(target, Decl(inferenceContextualReturnTypeUnion3.ts, 34, 7)) +>proto : Symbol(proto, Decl(inferenceContextualReturnTypeUnion3.ts, 34, 14)) + + message, +>message : Symbol(message, Decl(inferenceContextualReturnTypeUnion3.ts, 12, 7)) + + code, +>code : Symbol(code, Decl(inferenceContextualReturnTypeUnion3.ts, 8, 15)) + + ), + }); +}; diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion3.types b/tests/baselines/reference/inferenceContextualReturnTypeUnion3.types new file mode 100644 index 0000000000000..538f7397a0320 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion3.types @@ -0,0 +1,237 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion3.ts] //// + +=== inferenceContextualReturnTypeUnion3.ts === +declare function deprecate( +>deprecate : (fn: T, msg: string, code?: string) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ + + fn: T, +>fn : T +> : ^ + + msg: string, +>msg : string +> : ^^^^^^ + + code?: string, +>code : string | undefined +> : ^^^^^^^^^^^^^^^^^^ + +): T; + +const soonFrozenObjectDeprecation = ( +>soonFrozenObjectDeprecation : (obj: T, name: string, code: string, note?: string) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^ +>( obj: T, name: string, code: string, note = "",): T => { const message = `${name} will be frozen in future, all modifications are deprecated.${ note && `\n${note}` }`; return new Proxy(obj, { set: deprecate( (target, property, value, receiver) => Reflect.set(target, property, value, receiver), message, code, ), defineProperty: deprecate( (target, property, descriptor) => Reflect.defineProperty(target, property, descriptor), message, code, ), deleteProperty: deprecate( (target, property) => Reflect.deleteProperty(target, property), message, code, ), setPrototypeOf: deprecate( (target, proto) => Reflect.setPrototypeOf(target, proto), message, code, ), });} : (obj: T, name: string, code: string, note?: string) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^ + + obj: T, +>obj : T +> : ^ + + name: string, +>name : string +> : ^^^^^^ + + code: string, +>code : string +> : ^^^^^^ + + note = "", +>note : string +> : ^^^^^^ +>"" : "" +> : ^^ + +): T => { + const message = `${name} will be frozen in future, all modifications are deprecated.${ +>message : string +> : ^^^^^^ +>`${name} will be frozen in future, all modifications are deprecated.${ note && `\n${note}` }` : string +> : ^^^^^^ +>name : string +> : ^^^^^^ + + note && `\n${note}` +>note && `\n${note}` : string +> : ^^^^^^ +>note : string +> : ^^^^^^ +>`\n${note}` : string +> : ^^^^^^ +>note : string +> : ^^^^^^ + + }`; + return new Proxy(obj, { +>new Proxy(obj, { set: deprecate( (target, property, value, receiver) => Reflect.set(target, property, value, receiver), message, code, ), defineProperty: deprecate( (target, property, descriptor) => Reflect.defineProperty(target, property, descriptor), message, code, ), deleteProperty: deprecate( (target, property) => Reflect.deleteProperty(target, property), message, code, ), setPrototypeOf: deprecate( (target, proto) => Reflect.setPrototypeOf(target, proto), message, code, ), }) : T +> : ^ +>Proxy : ProxyConstructor +> : ^^^^^^^^^^^^^^^^ +>obj : T +> : ^ +>{ set: deprecate( (target, property, value, receiver) => Reflect.set(target, property, value, receiver), message, code, ), defineProperty: deprecate( (target, property, descriptor) => Reflect.defineProperty(target, property, descriptor), message, code, ), deleteProperty: deprecate( (target, property) => Reflect.deleteProperty(target, property), message, code, ), setPrototypeOf: deprecate( (target, proto) => Reflect.setPrototypeOf(target, proto), message, code, ), } : { set: (target: T, property: string | symbol, value: any, receiver: any) => boolean; defineProperty: (target: T, property: string | symbol, descriptor: PropertyDescriptor) => boolean; deleteProperty: (target: T, property: string | symbol) => boolean; setPrototypeOf: (target: T, proto: object | null) => boolean; } +> : ^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + set: deprecate( +>set : (target: T, property: string | symbol, value: any, receiver: any) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^^^ +>deprecate( (target, property, value, receiver) => Reflect.set(target, property, value, receiver), message, code, ) : (target: T, property: string | symbol, value: any, receiver: any) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^^^ +>deprecate : (fn: T_1, msg: string, code?: string) => T_1 +> : ^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ + + (target, property, value, receiver) => +>(target, property, value, receiver) => Reflect.set(target, property, value, receiver) : (target: T, property: string | symbol, value: any, receiver: any) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ +>value : any +>receiver : any + + Reflect.set(target, property, value, receiver), +>Reflect.set(target, property, value, receiver) : boolean +> : ^^^^^^^ +>Reflect.set : { (target: T_1, propertyKey: P, value: P extends keyof T_1 ? T_1[P] : any, receiver?: any): boolean; (target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; } +> : ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ +>Reflect : typeof Reflect +> : ^^^^^^^^^^^^^^ +>set : { (target: T_1, propertyKey: P, value: P extends keyof T_1 ? T_1[P] : any, receiver?: any): boolean; (target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; } +> : ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ +>value : any +>receiver : any + + message, +>message : string +> : ^^^^^^ + + code, +>code : string +> : ^^^^^^ + + ), + defineProperty: deprecate( +>defineProperty : (target: T, property: string | symbol, descriptor: PropertyDescriptor) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate( (target, property, descriptor) => Reflect.defineProperty(target, property, descriptor), message, code, ) : (target: T, property: string | symbol, descriptor: PropertyDescriptor) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate : (fn: T_1, msg: string, code?: string) => T_1 +> : ^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ + + (target, property, descriptor) => +>(target, property, descriptor) => Reflect.defineProperty(target, property, descriptor) : (target: T, property: string | symbol, descriptor: PropertyDescriptor) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ +>descriptor : PropertyDescriptor +> : ^^^^^^^^^^^^^^^^^^ + + Reflect.defineProperty(target, property, descriptor), +>Reflect.defineProperty(target, property, descriptor) : boolean +> : ^^^^^^^ +>Reflect.defineProperty : (target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType) => boolean +> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ +>Reflect : typeof Reflect +> : ^^^^^^^^^^^^^^ +>defineProperty : (target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType) => boolean +> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ +>descriptor : PropertyDescriptor +> : ^^^^^^^^^^^^^^^^^^ + + message, +>message : string +> : ^^^^^^ + + code, +>code : string +> : ^^^^^^ + + ), + deleteProperty: deprecate( +>deleteProperty : (target: T, property: string | symbol) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate( (target, property) => Reflect.deleteProperty(target, property), message, code, ) : (target: T, property: string | symbol) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate : (fn: T_1, msg: string, code?: string) => T_1 +> : ^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ + + (target, property) => Reflect.deleteProperty(target, property), +>(target, property) => Reflect.deleteProperty(target, property) : (target: T, property: string | symbol) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ +>Reflect.deleteProperty(target, property) : boolean +> : ^^^^^^^ +>Reflect.deleteProperty : (target: object, propertyKey: PropertyKey) => boolean +> : ^ ^^ ^^ ^^ ^^^^^ +>Reflect : typeof Reflect +> : ^^^^^^^^^^^^^^ +>deleteProperty : (target: object, propertyKey: PropertyKey) => boolean +> : ^ ^^ ^^ ^^ ^^^^^ +>target : T +> : ^ +>property : string | symbol +> : ^^^^^^^^^^^^^^^ + + message, +>message : string +> : ^^^^^^ + + code, +>code : string +> : ^^^^^^ + + ), + setPrototypeOf: deprecate( +>setPrototypeOf : (target: T, proto: object | null) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate( (target, proto) => Reflect.setPrototypeOf(target, proto), message, code, ) : (target: T, proto: object | null) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>deprecate : (fn: T_1, msg: string, code?: string) => T_1 +> : ^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ + + (target, proto) => Reflect.setPrototypeOf(target, proto), +>(target, proto) => Reflect.setPrototypeOf(target, proto) : (target: T, proto: object | null) => boolean +> : ^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>target : T +> : ^ +>proto : object | null +> : ^^^^^^^^^^^^^ +>Reflect.setPrototypeOf(target, proto) : boolean +> : ^^^^^^^ +>Reflect.setPrototypeOf : (target: object, proto: object | null) => boolean +> : ^ ^^ ^^ ^^ ^^^^^ +>Reflect : typeof Reflect +> : ^^^^^^^^^^^^^^ +>setPrototypeOf : (target: object, proto: object | null) => boolean +> : ^ ^^ ^^ ^^ ^^^^^ +>target : T +> : ^ +>proto : object | null +> : ^^^^^^^^^^^^^ + + message, +>message : string +> : ^^^^^^ + + code, +>code : string +> : ^^^^^^ + + ), + }); +}; diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion4.symbols b/tests/baselines/reference/inferenceContextualReturnTypeUnion4.symbols new file mode 100644 index 0000000000000..c4d39728acb77 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion4.symbols @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion4.ts] //// + +=== inferenceContextualReturnTypeUnion4.ts === +// https://github.com/microsoft/TypeScript/issues/57905 + +export abstract class Storage { +>Storage : Symbol(Storage, Decl(inferenceContextualReturnTypeUnion4.ts, 0, 0)) + + abstract get(): T | Promise; +>get : Symbol(Storage.get, Decl(inferenceContextualReturnTypeUnion4.ts, 2, 31)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 3, 17)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 3, 17)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 3, 17)) +} + +export abstract class SyncStorage extends Storage { +>SyncStorage : Symbol(SyncStorage, Decl(inferenceContextualReturnTypeUnion4.ts, 4, 1)) +>Storage : Symbol(Storage, Decl(inferenceContextualReturnTypeUnion4.ts, 0, 0)) + + abstract override get(): T; +>get : Symbol(SyncStorage.get, Decl(inferenceContextualReturnTypeUnion4.ts, 6, 51)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 7, 26)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 7, 26)) +} + +export abstract class ASyncStorage extends Storage { +>ASyncStorage : Symbol(ASyncStorage, Decl(inferenceContextualReturnTypeUnion4.ts, 8, 1)) +>Storage : Symbol(Storage, Decl(inferenceContextualReturnTypeUnion4.ts, 0, 0)) + + abstract override get(): Promise; +>get : Symbol(ASyncStorage.get, Decl(inferenceContextualReturnTypeUnion4.ts, 10, 52)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 11, 26)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>T : Symbol(T, Decl(inferenceContextualReturnTypeUnion4.ts, 11, 26)) +} + diff --git a/tests/baselines/reference/inferenceContextualReturnTypeUnion4.types b/tests/baselines/reference/inferenceContextualReturnTypeUnion4.types new file mode 100644 index 0000000000000..af2d1a21a96d5 --- /dev/null +++ b/tests/baselines/reference/inferenceContextualReturnTypeUnion4.types @@ -0,0 +1,36 @@ +//// [tests/cases/compiler/inferenceContextualReturnTypeUnion4.ts] //// + +=== inferenceContextualReturnTypeUnion4.ts === +// https://github.com/microsoft/TypeScript/issues/57905 + +export abstract class Storage { +>Storage : Storage +> : ^^^^^^^ + + abstract get(): T | Promise; +>get : () => T | Promise +> : ^ ^^^^^^^^^ ^^^^^^^ +} + +export abstract class SyncStorage extends Storage { +>SyncStorage : SyncStorage +> : ^^^^^^^^^^^ +>Storage : Storage +> : ^^^^^^^ + + abstract override get(): T; +>get : () => T +> : ^ ^^^^^^^^^ ^^^^^^^ +} + +export abstract class ASyncStorage extends Storage { +>ASyncStorage : ASyncStorage +> : ^^^^^^^^^^^^ +>Storage : Storage +> : ^^^^^^^ + + abstract override get(): Promise; +>get : () => Promise +> : ^ ^^^^^^^^^ ^^^^^^^ +} + diff --git a/tests/baselines/reference/jsdocTemplateTag.errors.txt b/tests/baselines/reference/jsdocTemplateTag.errors.txt index 74a150c6e3cd0..308b9e4bd23c7 100644 --- a/tests/baselines/reference/jsdocTemplateTag.errors.txt +++ b/tests/baselines/reference/jsdocTemplateTag.errors.txt @@ -1,4 +1,4 @@ -forgot.js(23,1): error TS2322: Type '(keyframes: any[]) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. +forgot.js(23,1): error TS2322: Type '(keyframes: Array) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. Type 'void' is not assignable to type 'Animation'. @@ -27,6 +27,6 @@ forgot.js(23,1): error TS2322: Type '(keyframes: any[]) => void' is not assignab */ Element.prototype.animate = function(keyframes) {}; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '(keyframes: any[]) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. +!!! error TS2322: Type '(keyframes: Array) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. !!! error TS2322: Type 'void' is not assignable to type 'Animation'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt index d3fe9ca151c49..72adf78dfc2fc 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt @@ -4,7 +4,7 @@ moduleClassArrayCodeGenTest.ts(10,11): error TS2694: Namespace 'M' has no export ==== moduleClassArrayCodeGenTest.ts (1 errors) ==== // Invalid code gen for Array of Module class - module M + namespace M { export class A { } class B{ } diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.js b/tests/baselines/reference/moduleClassArrayCodeGenTest.js index b67a42a03a051..05fa75d326dd2 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.js +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.js @@ -3,7 +3,7 @@ //// [moduleClassArrayCodeGenTest.ts] // Invalid code gen for Array of Module class -module M +namespace M { export class A { } class B{ } diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.symbols b/tests/baselines/reference/moduleClassArrayCodeGenTest.symbols index 0c4e636bc863c..f52f757893297 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.symbols +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.symbols @@ -3,7 +3,7 @@ === moduleClassArrayCodeGenTest.ts === // Invalid code gen for Array of Module class -module M +namespace M >M : Symbol(M, Decl(moduleClassArrayCodeGenTest.ts, 0, 0)) { export class A { } diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.types b/tests/baselines/reference/moduleClassArrayCodeGenTest.types index ced3a0ab7a366..ba377eb9f5a50 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.types +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.types @@ -3,7 +3,7 @@ === moduleClassArrayCodeGenTest.ts === // Invalid code gen for Array of Module class -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/moduleKeywordDeprecated.errors.txt b/tests/baselines/reference/moduleKeywordDeprecated.errors.txt new file mode 100644 index 0000000000000..6f1a31c5eb05e --- /dev/null +++ b/tests/baselines/reference/moduleKeywordDeprecated.errors.txt @@ -0,0 +1,58 @@ +decl.d.ts(1,16): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +decl.d.ts(2,16): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +decl.d.ts(2,20): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +decl.d.ts(7,15): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +decl.d.ts(8,15): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +decl.d.ts(8,24): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(2,8): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(3,8): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(3,12): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(4,16): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(5,16): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. +foo.ts(5,21): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + + +==== foo.ts (6 errors) ==== + // Error + module notok { } + ~~~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + module not.ok { } + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + ~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + declare module bad { } + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + declare module also.bad { } + ~~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + + // Still the only way to do it + declare module "good" { } + +==== decl.d.ts (6 errors) ==== + declare module foo { } + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + declare module foo.bar { } + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + + // Still the only way to do it + declare module "alsogood" { } + + export module exported { } + ~~~~~~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + export module exported.sub { } + ~~~~~~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + ~~~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. + \ No newline at end of file diff --git a/tests/baselines/reference/moduleKeywordDeprecated.js b/tests/baselines/reference/moduleKeywordDeprecated.js new file mode 100644 index 0000000000000..7306e67af7ff8 --- /dev/null +++ b/tests/baselines/reference/moduleKeywordDeprecated.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/moduleKeywordDeprecated.ts] //// + +//// [foo.ts] +// Error +module notok { } +module not.ok { } +declare module bad { } +declare module also.bad { } + +// Still the only way to do it +declare module "good" { } + +//// [decl.d.ts] +declare module foo { } +declare module foo.bar { } + +// Still the only way to do it +declare module "alsogood" { } + +export module exported { } +export module exported.sub { } + + +//// [foo.js] diff --git a/tests/baselines/reference/moduleKeywordDeprecated.symbols b/tests/baselines/reference/moduleKeywordDeprecated.symbols new file mode 100644 index 0000000000000..ce5f75431f7b3 --- /dev/null +++ b/tests/baselines/reference/moduleKeywordDeprecated.symbols @@ -0,0 +1,41 @@ +//// [tests/cases/compiler/moduleKeywordDeprecated.ts] //// + +=== foo.ts === +// Error +module notok { } +>notok : Symbol(notok, Decl(foo.ts, 0, 0)) + +module not.ok { } +>not : Symbol(not, Decl(foo.ts, 1, 16)) +>ok : Symbol(ok, Decl(foo.ts, 2, 11)) + +declare module bad { } +>bad : Symbol(bad, Decl(foo.ts, 2, 17)) + +declare module also.bad { } +>also : Symbol(also, Decl(foo.ts, 3, 22)) +>bad : Symbol(bad, Decl(foo.ts, 4, 20)) + +// Still the only way to do it +declare module "good" { } +>"good" : Symbol("good", Decl(foo.ts, 4, 27)) + +=== decl.d.ts === +declare module foo { } +>foo : Symbol(foo, Decl(decl.d.ts, 0, 0), Decl(decl.d.ts, 0, 22)) + +declare module foo.bar { } +>foo : Symbol(foo, Decl(decl.d.ts, 0, 0), Decl(decl.d.ts, 0, 22)) +>bar : Symbol(bar, Decl(decl.d.ts, 1, 19)) + +// Still the only way to do it +declare module "alsogood" { } +>"alsogood" : Symbol("alsogood", Decl(decl.d.ts, 1, 26)) + +export module exported { } +>exported : Symbol(exported, Decl(decl.d.ts, 4, 29), Decl(decl.d.ts, 6, 26)) + +export module exported.sub { } +>exported : Symbol(exported, Decl(decl.d.ts, 4, 29), Decl(decl.d.ts, 6, 26)) +>sub : Symbol(sub, Decl(decl.d.ts, 7, 23)) + diff --git a/tests/baselines/reference/moduleKeywordDeprecated.types b/tests/baselines/reference/moduleKeywordDeprecated.types new file mode 100644 index 0000000000000..ac2bdc5fcd7ec --- /dev/null +++ b/tests/baselines/reference/moduleKeywordDeprecated.types @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/moduleKeywordDeprecated.ts] //// + +=== foo.ts === +// Error +module notok { } +module not.ok { } +declare module bad { } +declare module also.bad { } + +// Still the only way to do it +declare module "good" { } +>"good" : typeof import("good") +> : ^^^^^^^^^^^^^^^^^^^^^ + +=== decl.d.ts === +declare module foo { } +declare module foo.bar { } + +// Still the only way to do it +declare module "alsogood" { } +>"alsogood" : any +> : ^^^ + +export module exported { } +export module exported.sub { } + diff --git a/tests/baselines/reference/moduleMerge.js b/tests/baselines/reference/moduleMerge.js index ecace8f22c78b..155d1d93c80a0 100644 --- a/tests/baselines/reference/moduleMerge.js +++ b/tests/baselines/reference/moduleMerge.js @@ -3,7 +3,7 @@ //// [moduleMerge.ts] // This should not compile both B classes are in the same module this should be a collission -module A +namespace A { class B { @@ -14,7 +14,7 @@ module A } } -module A +namespace A { export class B { diff --git a/tests/baselines/reference/moduleMerge.symbols b/tests/baselines/reference/moduleMerge.symbols index bb06dbe912148..7ff92d181f45b 100644 --- a/tests/baselines/reference/moduleMerge.symbols +++ b/tests/baselines/reference/moduleMerge.symbols @@ -3,7 +3,7 @@ === moduleMerge.ts === // This should not compile both B classes are in the same module this should be a collission -module A +namespace A >A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) { class B @@ -17,7 +17,7 @@ module A } } -module A +namespace A >A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) { export class B diff --git a/tests/baselines/reference/moduleMerge.types b/tests/baselines/reference/moduleMerge.types index 8e746a04b5e76..32f5584e7de55 100644 --- a/tests/baselines/reference/moduleMerge.types +++ b/tests/baselines/reference/moduleMerge.types @@ -3,7 +3,7 @@ === moduleMerge.ts === // This should not compile both B classes are in the same module this should be a collission -module A +namespace A >A : typeof A > : ^^^^^^^^ { @@ -22,7 +22,7 @@ module A } } -module A +namespace A >A : typeof A > : ^^^^^^^^ { diff --git a/tests/baselines/reference/moduleScopingBug.js b/tests/baselines/reference/moduleScopingBug.js index fbae6fc736971..324a64d1375b4 100644 --- a/tests/baselines/reference/moduleScopingBug.js +++ b/tests/baselines/reference/moduleScopingBug.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/moduleScopingBug.ts] //// //// [moduleScopingBug.ts] -module M +namespace M { diff --git a/tests/baselines/reference/moduleScopingBug.symbols b/tests/baselines/reference/moduleScopingBug.symbols index b744846fd8525..b483474e6d24e 100644 --- a/tests/baselines/reference/moduleScopingBug.symbols +++ b/tests/baselines/reference/moduleScopingBug.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/moduleScopingBug.ts] //// === moduleScopingBug.ts === -module M +namespace M >M : Symbol(M, Decl(moduleScopingBug.ts, 0, 0)) { diff --git a/tests/baselines/reference/moduleScopingBug.types b/tests/baselines/reference/moduleScopingBug.types index 4c375677fbdc3..dd11f06a9f4de 100644 --- a/tests/baselines/reference/moduleScopingBug.types +++ b/tests/baselines/reference/moduleScopingBug.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/moduleScopingBug.ts] //// === moduleScopingBug.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.js b/tests/baselines/reference/namedFunctionExpressionInModule.js index e835f55ebc58c..80ca717335350 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.js +++ b/tests/baselines/reference/namedFunctionExpressionInModule.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/namedFunctionExpressionInModule.ts] //// //// [namedFunctionExpressionInModule.ts] -module Variables{ +namespace Variables{ var x = function bar(a, b, c) { } x(1, 2, 3); diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.symbols b/tests/baselines/reference/namedFunctionExpressionInModule.symbols index 7ab00121354d2..9352b8c3960e3 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.symbols +++ b/tests/baselines/reference/namedFunctionExpressionInModule.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/namedFunctionExpressionInModule.ts] //// === namedFunctionExpressionInModule.ts === -module Variables{ +namespace Variables{ >Variables : Symbol(Variables, Decl(namedFunctionExpressionInModule.ts, 0, 0)) var x = function bar(a, b, c) { diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 64f8af41eeeff..455a4b570499c 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/namedFunctionExpressionInModule.ts] //// === namedFunctionExpressionInModule.ts === -module Variables{ +namespace Variables{ >Variables : typeof Variables > : ^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/nestedModulePrivateAccess.js b/tests/baselines/reference/nestedModulePrivateAccess.js index a887bc6d85be9..5e042553ce88a 100644 --- a/tests/baselines/reference/nestedModulePrivateAccess.js +++ b/tests/baselines/reference/nestedModulePrivateAccess.js @@ -1,9 +1,9 @@ //// [tests/cases/compiler/nestedModulePrivateAccess.ts] //// //// [nestedModulePrivateAccess.ts] -module a{ +namespace a{ var x:number; - module b{ + namespace b{ var y = x; // should not be an error } } diff --git a/tests/baselines/reference/nestedModulePrivateAccess.symbols b/tests/baselines/reference/nestedModulePrivateAccess.symbols index a9f18e367252a..064b67c4e4559 100644 --- a/tests/baselines/reference/nestedModulePrivateAccess.symbols +++ b/tests/baselines/reference/nestedModulePrivateAccess.symbols @@ -1,13 +1,13 @@ //// [tests/cases/compiler/nestedModulePrivateAccess.ts] //// === nestedModulePrivateAccess.ts === -module a{ +namespace a{ >a : Symbol(a, Decl(nestedModulePrivateAccess.ts, 0, 0)) var x:number; >x : Symbol(x, Decl(nestedModulePrivateAccess.ts, 1, 10)) - module b{ + namespace b{ >b : Symbol(b, Decl(nestedModulePrivateAccess.ts, 1, 20)) var y = x; // should not be an error diff --git a/tests/baselines/reference/nestedModulePrivateAccess.types b/tests/baselines/reference/nestedModulePrivateAccess.types index 5e6b85bc619b3..e3a1cb577308c 100644 --- a/tests/baselines/reference/nestedModulePrivateAccess.types +++ b/tests/baselines/reference/nestedModulePrivateAccess.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/nestedModulePrivateAccess.ts] //// === nestedModulePrivateAccess.ts === -module a{ +namespace a{ >a : typeof a > : ^^^^^^^^ @@ -9,7 +9,7 @@ module a{ >x : number > : ^^^^^^ - module b{ + namespace b{ >b : typeof b > : ^^^^^^^^ diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.js b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.js new file mode 100644 index 0000000000000..bcf39b25bc97d --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.js @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts] //// + +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "imports": { + "#/*": "./src/*" + } +} +//// [foo.ts] +export const foo = "foo"; +//// [bar.ts] +export const bar = "bar"; +//// [baz.ts] +export const baz = "baz"; +//// [index.ts] +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +//// [index.mts] +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +//// [index.cts] +// cjs format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; + + +//// [foo.js] +export const foo = "foo"; +//// [bar.js] +export const bar = "bar"; +//// [baz.js] +export const baz = "baz"; +//// [index.js] +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +//// [index.mjs] +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const foo_js_1 = require("#/foo.js"); +const bar_js_1 = require("#/features/bar.js"); +const baz_js_1 = require("#/nested/deep/baz.js"); +foo_js_1.foo; +bar_js_1.bar; +baz_js_1.baz; + + +//// [foo.d.ts] +export declare const foo = "foo"; +//// [bar.d.ts] +export declare const bar = "bar"; +//// [baz.d.ts] +export declare const baz = "baz"; +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.symbols b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.symbols new file mode 100644 index 0000000000000..e4aebad35fd9e --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.symbols @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts] //// + +=== src/foo.ts === +export const foo = "foo"; +>foo : Symbol(foo, Decl(foo.ts, 0, 12)) + +=== src/features/bar.ts === +export const bar = "bar"; +>bar : Symbol(bar, Decl(bar.ts, 0, 12)) + +=== src/nested/deep/baz.ts === +export const baz = "baz"; +>baz : Symbol(baz, Decl(baz.ts, 0, 12)) + +=== index.ts === +// esm format file +import { foo } from "#/foo.js"; +>foo : Symbol(foo, Decl(index.ts, 1, 8)) + +import { bar } from "#/features/bar.js"; +>bar : Symbol(bar, Decl(index.ts, 2, 8)) + +import { baz } from "#/nested/deep/baz.js"; +>baz : Symbol(baz, Decl(index.ts, 3, 8)) + +foo; +>foo : Symbol(foo, Decl(index.ts, 1, 8)) + +bar; +>bar : Symbol(bar, Decl(index.ts, 2, 8)) + +baz; +>baz : Symbol(baz, Decl(index.ts, 3, 8)) + +=== index.mts === +// esm format file +import { foo } from "#/foo.js"; +>foo : Symbol(foo, Decl(index.mts, 1, 8)) + +import { bar } from "#/features/bar.js"; +>bar : Symbol(bar, Decl(index.mts, 2, 8)) + +import { baz } from "#/nested/deep/baz.js"; +>baz : Symbol(baz, Decl(index.mts, 3, 8)) + +foo; +>foo : Symbol(foo, Decl(index.mts, 1, 8)) + +bar; +>bar : Symbol(bar, Decl(index.mts, 2, 8)) + +baz; +>baz : Symbol(baz, Decl(index.mts, 3, 8)) + +=== index.cts === +// cjs format file +import { foo } from "#/foo.js"; +>foo : Symbol(foo, Decl(index.cts, 1, 8)) + +import { bar } from "#/features/bar.js"; +>bar : Symbol(bar, Decl(index.cts, 2, 8)) + +import { baz } from "#/nested/deep/baz.js"; +>baz : Symbol(baz, Decl(index.cts, 3, 8)) + +foo; +>foo : Symbol(foo, Decl(index.cts, 1, 8)) + +bar; +>bar : Symbol(bar, Decl(index.cts, 2, 8)) + +baz; +>baz : Symbol(baz, Decl(index.cts, 3, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.trace.json b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.trace.json new file mode 100644 index 0000000000000..0288c73254478 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.trace.json @@ -0,0 +1,243 @@ +[ + "File '/.src/src/package.json' does not exist.", + "Found 'package.json' at '/.src/package.json'.", + "File '/.src/src/features/package.json' does not exist.", + "File '/.src/src/package.json' does not exist according to earlier cached lookups.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "File '/.src/src/nested/deep/package.json' does not exist.", + "File '/.src/src/nested/package.json' does not exist.", + "File '/.src/src/package.json' does not exist according to earlier cached lookups.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "======== Resolving module '#/foo.js' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/foo.js'.", + "File name '/.src/src/foo.js' has a '.js' extension - stripping it.", + "File '/.src/src/foo.ts' exists - use it as a name resolution result.", + "======== Module name '#/foo.js' was successfully resolved to '/.src/src/foo.ts'. ========", + "======== Resolving module '#/features/bar.js' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/features/bar.js'.", + "File name '/.src/src/features/bar.js' has a '.js' extension - stripping it.", + "File '/.src/src/features/bar.ts' exists - use it as a name resolution result.", + "======== Module name '#/features/bar.js' was successfully resolved to '/.src/src/features/bar.ts'. ========", + "======== Resolving module '#/nested/deep/baz.js' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/nested/deep/baz.js'.", + "File name '/.src/src/nested/deep/baz.js' has a '.js' extension - stripping it.", + "File '/.src/src/nested/deep/baz.ts' exists - use it as a name resolution result.", + "======== Module name '#/nested/deep/baz.js' was successfully resolved to '/.src/src/nested/deep/baz.ts'. ========", + "======== Resolving module '#/foo.js' from '/.src/index.mts'. ========", + "Resolution for module '#/foo.js' was found in cache from location '/.src'.", + "======== Module name '#/foo.js' was successfully resolved to '/.src/src/foo.ts'. ========", + "======== Resolving module '#/features/bar.js' from '/.src/index.mts'. ========", + "Resolution for module '#/features/bar.js' was found in cache from location '/.src'.", + "======== Module name '#/features/bar.js' was successfully resolved to '/.src/src/features/bar.ts'. ========", + "======== Resolving module '#/nested/deep/baz.js' from '/.src/index.mts'. ========", + "Resolution for module '#/nested/deep/baz.js' was found in cache from location '/.src'.", + "======== Module name '#/nested/deep/baz.js' was successfully resolved to '/.src/src/nested/deep/baz.ts'. ========", + "======== Resolving module '#/foo.js' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/foo.js'.", + "File name '/.src/src/foo.js' has a '.js' extension - stripping it.", + "File '/.src/src/foo.ts' exists - use it as a name resolution result.", + "======== Module name '#/foo.js' was successfully resolved to '/.src/src/foo.ts'. ========", + "======== Resolving module '#/features/bar.js' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/features/bar.js'.", + "File name '/.src/src/features/bar.js' has a '.js' extension - stripping it.", + "File '/.src/src/features/bar.ts' exists - use it as a name resolution result.", + "======== Module name '#/features/bar.js' was successfully resolved to '/.src/src/features/bar.ts'. ========", + "======== Resolving module '#/nested/deep/baz.js' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'NodeNext'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#/*' with target './src/nested/deep/baz.js'.", + "File name '/.src/src/nested/deep/baz.js' has a '.js' extension - stripping it.", + "File '/.src/src/nested/deep/baz.ts' exists - use it as a name resolution result.", + "======== Module name '#/nested/deep/baz.js' was successfully resolved to '/.src/src/nested/deep/baz.ts'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.types b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.types new file mode 100644 index 0000000000000..8bb760005c9f6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcard.types @@ -0,0 +1,101 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts] //// + +=== src/foo.ts === +export const foo = "foo"; +>foo : "foo" +> : ^^^^^ +>"foo" : "foo" +> : ^^^^^ + +=== src/features/bar.ts === +export const bar = "bar"; +>bar : "bar" +> : ^^^^^ +>"bar" : "bar" +> : ^^^^^ + +=== src/nested/deep/baz.ts === +export const baz = "baz"; +>baz : "baz" +> : ^^^^^ +>"baz" : "baz" +> : ^^^^^ + +=== index.ts === +// esm format file +import { foo } from "#/foo.js"; +>foo : "foo" +> : ^^^^^ + +import { bar } from "#/features/bar.js"; +>bar : "bar" +> : ^^^^^ + +import { baz } from "#/nested/deep/baz.js"; +>baz : "baz" +> : ^^^^^ + +foo; +>foo : "foo" +> : ^^^^^ + +bar; +>bar : "bar" +> : ^^^^^ + +baz; +>baz : "baz" +> : ^^^^^ + +=== index.mts === +// esm format file +import { foo } from "#/foo.js"; +>foo : "foo" +> : ^^^^^ + +import { bar } from "#/features/bar.js"; +>bar : "bar" +> : ^^^^^ + +import { baz } from "#/nested/deep/baz.js"; +>baz : "baz" +> : ^^^^^ + +foo; +>foo : "foo" +> : ^^^^^ + +bar; +>bar : "bar" +> : ^^^^^ + +baz; +>baz : "baz" +> : ^^^^^ + +=== index.cts === +// cjs format file +import { foo } from "#/foo.js"; +>foo : "foo" +> : ^^^^^ + +import { bar } from "#/features/bar.js"; +>bar : "bar" +> : ^^^^^ + +import { baz } from "#/nested/deep/baz.js"; +>baz : "baz" +> : ^^^^^ + +foo; +>foo : "foo" +> : ^^^^^ + +bar; +>bar : "bar" +> : ^^^^^ + +baz; +>baz : "baz" +> : ^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.errors.txt b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.errors.txt new file mode 100644 index 0000000000000..ea7a1a87966ac --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.errors.txt @@ -0,0 +1,21 @@ +index.ts(2,21): error TS2307: Cannot find module '#/foo.js' or its corresponding type declarations. + + +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "imports": { + "#/*": "./src/*" + } + } +==== src/foo.ts (0 errors) ==== + export const foo = "foo"; +==== index.ts (1 errors) ==== + // esm format file + import { foo } from "#/foo.js"; + ~~~~~~~~~~ +!!! error TS2307: Cannot find module '#/foo.js' or its corresponding type declarations. + foo; + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.js b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.js new file mode 100644 index 0000000000000..11a8e0b727b73 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.js @@ -0,0 +1,31 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts] //// + +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "imports": { + "#/*": "./src/*" + } +} +//// [foo.ts] +export const foo = "foo"; +//// [index.ts] +// esm format file +import { foo } from "#/foo.js"; +foo; + + +//// [foo.js] +export const foo = "foo"; +//// [index.js] +// esm format file +import { foo } from "#/foo.js"; +foo; + + +//// [foo.d.ts] +export declare const foo = "foo"; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.symbols b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.symbols new file mode 100644 index 0000000000000..368e6fca91428 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.symbols @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts] //// + +=== src/foo.ts === +export const foo = "foo"; +>foo : Symbol(foo, Decl(foo.ts, 0, 12)) + +=== index.ts === +// esm format file +import { foo } from "#/foo.js"; +>foo : Symbol(foo, Decl(index.ts, 1, 8)) + +foo; +>foo : Symbol(foo, Decl(index.ts, 1, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.trace.json b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.trace.json new file mode 100644 index 0000000000000..828698cd828cb --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.trace.json @@ -0,0 +1,150 @@ +[ + "File '/.src/src/package.json' does not exist.", + "Found 'package.json' at '/.src/package.json'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "======== Resolving module '#/foo.js' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "Invalid import specifier '#/foo.js' has no possible resolutions.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module '#/foo.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "File name '/.src/node_modules/#/foo.js' has a '.js' extension - stripping it.", + "File name '/.src/node_modules/@types/#/foo.js' has a '.js' extension - stripping it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "File name '/node_modules/#/foo.js' has a '.js' extension - stripping it.", + "File name '/node_modules/@types/#/foo.js' has a '.js' extension - stripping it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "File name '/.src/node_modules/#/foo.js' has a '.js' extension - stripping it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "File name '/node_modules/#/foo.js' has a '.js' extension - stripping it.", + "======== Module name '#/foo.js' was not resolved. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.types b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.types new file mode 100644 index 0000000000000..1c3c0f9712a52 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImportsRootWildcardNode16.types @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts] //// + +=== src/foo.ts === +export const foo = "foo"; +>foo : "foo" +> : ^^^^^ +>"foo" : "foo" +> : ^^^^^ + +=== index.ts === +// esm format file +import { foo } from "#/foo.js"; +>foo : any +> : ^^^ + +foo; +>foo : any +> : ^^^ + diff --git a/tests/baselines/reference/parseInvalidNames.errors.txt b/tests/baselines/reference/parseInvalidNames.errors.txt index cae7dfc6ad8e2..7dbefbda3da6b 100644 --- a/tests/baselines/reference/parseInvalidNames.errors.txt +++ b/tests/baselines/reference/parseInvalidNames.errors.txt @@ -4,31 +4,24 @@ parseInvalidNames.ts(1,15): error TS1005: ';' expected. parseInvalidNames.ts(2,1): error TS2304: Cannot find name 'interface'. parseInvalidNames.ts(2,11): error TS2427: Interface name cannot be '100'. parseInvalidNames.ts(2,15): error TS1005: ';' expected. -parseInvalidNames.ts(3,1): error TS2304: Cannot find name 'namespace'. -parseInvalidNames.ts(3,11): error TS2819: Namespace name cannot be '100'. -parseInvalidNames.ts(3,15): error TS1005: ';' expected. -parseInvalidNames.ts(4,1): error TS2304: Cannot find name 'type'. -parseInvalidNames.ts(4,6): error TS2457: Type alias name cannot be '100'. -parseInvalidNames.ts(4,10): error TS1005: ';' expected. +parseInvalidNames.ts(3,1): error TS2304: Cannot find name 'type'. +parseInvalidNames.ts(3,6): error TS2457: Type alias name cannot be '100'. +parseInvalidNames.ts(3,10): error TS1005: ';' expected. +parseInvalidNames.ts(5,1): error TS1128: Declaration or statement expected. +parseInvalidNames.ts(5,8): error TS2304: Cannot find name 'namespace'. +parseInvalidNames.ts(5,18): error TS2819: Namespace name cannot be '100'. +parseInvalidNames.ts(5,22): error TS1005: ';' expected. parseInvalidNames.ts(6,1): error TS1128: Declaration or statement expected. -parseInvalidNames.ts(6,8): error TS2304: Cannot find name 'namespace'. -parseInvalidNames.ts(6,18): error TS2819: Namespace name cannot be '100'. +parseInvalidNames.ts(6,8): error TS2304: Cannot find name 'interface'. +parseInvalidNames.ts(6,18): error TS2427: Interface name cannot be '100'. parseInvalidNames.ts(6,22): error TS1005: ';' expected. parseInvalidNames.ts(7,1): error TS1128: Declaration or statement expected. -parseInvalidNames.ts(7,8): error TS2304: Cannot find name 'interface'. -parseInvalidNames.ts(7,18): error TS2427: Interface name cannot be '100'. -parseInvalidNames.ts(7,22): error TS1005: ';' expected. -parseInvalidNames.ts(8,1): error TS1128: Declaration or statement expected. -parseInvalidNames.ts(8,8): error TS2304: Cannot find name 'namespace'. -parseInvalidNames.ts(8,18): error TS2819: Namespace name cannot be '100'. -parseInvalidNames.ts(8,22): error TS1005: ';' expected. -parseInvalidNames.ts(9,1): error TS1128: Declaration or statement expected. -parseInvalidNames.ts(9,8): error TS2304: Cannot find name 'type'. -parseInvalidNames.ts(9,13): error TS2457: Type alias name cannot be '100'. -parseInvalidNames.ts(9,17): error TS1005: ';' expected. +parseInvalidNames.ts(7,8): error TS2304: Cannot find name 'type'. +parseInvalidNames.ts(7,13): error TS2457: Type alias name cannot be '100'. +parseInvalidNames.ts(7,17): error TS1005: ';' expected. -==== parseInvalidNames.ts (28 errors) ==== +==== parseInvalidNames.ts (21 errors) ==== namespace 100 {} ~~~~~~~~~ !!! error TS2304: Cannot find name 'namespace'. @@ -42,13 +35,6 @@ parseInvalidNames.ts(9,17): error TS1005: ';' expected. ~~~ !!! error TS2427: Interface name cannot be '100'. ~ -!!! error TS1005: ';' expected. - namespace 100 {} - ~~~~~~~~~ -!!! error TS2304: Cannot find name 'namespace'. - ~~~ -!!! error TS2819: Namespace name cannot be '100'. - ~ !!! error TS1005: ';' expected. type 100 {} ~~~~ @@ -75,15 +61,6 @@ parseInvalidNames.ts(9,17): error TS1005: ';' expected. ~~~ !!! error TS2427: Interface name cannot be '100'. ~ -!!! error TS1005: ';' expected. - export namespace 100 {} - ~~~~~~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~ -!!! error TS2304: Cannot find name 'namespace'. - ~~~ -!!! error TS2819: Namespace name cannot be '100'. - ~ !!! error TS1005: ';' expected. export type 100 {} ~~~~~~ diff --git a/tests/baselines/reference/parseInvalidNames.js b/tests/baselines/reference/parseInvalidNames.js index e26d364311d9f..86a62c5185cee 100644 --- a/tests/baselines/reference/parseInvalidNames.js +++ b/tests/baselines/reference/parseInvalidNames.js @@ -3,12 +3,10 @@ //// [parseInvalidNames.ts] namespace 100 {} interface 100 {} -namespace 100 {} type 100 {} export namespace 100 {} export interface 100 {} -export namespace 100 {} export type 100 {} @@ -19,9 +17,6 @@ namespace; interface; 100; { } -namespace; -100; -{ } type; 100; { } @@ -31,9 +26,6 @@ namespace; interface; 100; { } -namespace; -100; -{ } type; 100; { } diff --git a/tests/baselines/reference/parseInvalidNames.symbols b/tests/baselines/reference/parseInvalidNames.symbols index 4efc047b7f802..6f287d3ed0205 100644 --- a/tests/baselines/reference/parseInvalidNames.symbols +++ b/tests/baselines/reference/parseInvalidNames.symbols @@ -4,11 +4,9 @@ namespace 100 {} interface 100 {} -namespace 100 {} type 100 {} export namespace 100 {} export interface 100 {} -export namespace 100 {} export type 100 {} diff --git a/tests/baselines/reference/parseInvalidNames.types b/tests/baselines/reference/parseInvalidNames.types index f42c18c7f1c81..d7492c49f1ec6 100644 --- a/tests/baselines/reference/parseInvalidNames.types +++ b/tests/baselines/reference/parseInvalidNames.types @@ -13,12 +13,6 @@ interface 100 {} >100 : 100 > : ^^^ -namespace 100 {} ->namespace : any -> : ^^^ ->100 : 100 -> : ^^^ - type 100 {} >type : any > : ^^^ @@ -37,12 +31,6 @@ export interface 100 {} >100 : 100 > : ^^^ -export namespace 100 {} ->namespace : any -> : ^^^ ->100 : 100 -> : ^^^ - export type 100 {} >type : any > : ^^^ diff --git a/tests/baselines/reference/primaryExpressionMods.errors.txt b/tests/baselines/reference/primaryExpressionMods.errors.txt index 92495911da304..099090c580450 100644 --- a/tests/baselines/reference/primaryExpressionMods.errors.txt +++ b/tests/baselines/reference/primaryExpressionMods.errors.txt @@ -3,7 +3,7 @@ primaryExpressionMods.ts(11,8): error TS2833: Cannot find namespace 'm'. Did you ==== primaryExpressionMods.ts (2 errors) ==== - module M + namespace M { export interface P { x: number; y: number; } export var a = 1; @@ -18,5 +18,5 @@ primaryExpressionMods.ts(11,8): error TS2833: Cannot find namespace 'm'. Did you var q: m.P; // Error ~ !!! error TS2833: Cannot find namespace 'm'. Did you mean 'M'? -!!! related TS2728 primaryExpressionMods.ts:1:8: 'M' is declared here. +!!! related TS2728 primaryExpressionMods.ts:1:11: 'M' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/primaryExpressionMods.js b/tests/baselines/reference/primaryExpressionMods.js index b951d8a5a56fd..f30ed1792e3ca 100644 --- a/tests/baselines/reference/primaryExpressionMods.js +++ b/tests/baselines/reference/primaryExpressionMods.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/primaryExpressionMods.ts] //// //// [primaryExpressionMods.ts] -module M +namespace M { export interface P { x: number; y: number; } export var a = 1; diff --git a/tests/baselines/reference/primaryExpressionMods.symbols b/tests/baselines/reference/primaryExpressionMods.symbols index 4f135c0bbd0eb..366f6d92c8c07 100644 --- a/tests/baselines/reference/primaryExpressionMods.symbols +++ b/tests/baselines/reference/primaryExpressionMods.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/primaryExpressionMods.ts] //// === primaryExpressionMods.ts === -module M +namespace M >M : Symbol(M, Decl(primaryExpressionMods.ts, 0, 0)) { export interface P { x: number; y: number; } diff --git a/tests/baselines/reference/primaryExpressionMods.types b/tests/baselines/reference/primaryExpressionMods.types index 11cc211066ef1..b19a4422b31eb 100644 --- a/tests/baselines/reference/primaryExpressionMods.types +++ b/tests/baselines/reference/primaryExpressionMods.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/primaryExpressionMods.ts] //// === primaryExpressionMods.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt index 1ca880ef898ef..e524aa4cfe6c4 100644 --- a/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt +++ b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt @@ -5,7 +5,7 @@ error TS5107: Option 'moduleResolution=classic' is deprecated and will stop func !!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ref.d.ts (0 errors) ==== - declare module M1 + declare namespace M1 { export function f1(): void; } diff --git a/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt index cec554c516db9..e1b346e374150 100644 --- a/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt +++ b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt @@ -3,7 +3,7 @@ error TS5107: Option 'moduleResolution=classic' is deprecated and will stop func !!! error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ref.d.ts (0 errors) ==== - declare module M1 + declare namespace M1 { export function f1(): void; } diff --git a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt index b1f81b629f7d4..77480e253c19f 100644 --- a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt +++ b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt @@ -1,20 +1,23 @@ error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +decl.d.ts(8,19): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. in1.d.ts(1,8): error TS2300: Duplicate identifier 'a'. in2.d.ts(1,8): error TS2300: Duplicate identifier 'a'. !!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== decl.d.ts (0 errors) ==== +==== decl.d.ts (1 errors) ==== // bug 535531: duplicate identifier error reported for "import" declarations in separate files - declare module A + declare namespace A { class MyRoot { } - + export module B + ~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. { class MyClass{ } } diff --git a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt index a2584e6b97c29..b09fbc8824beb 100644 --- a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt +++ b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt @@ -1,18 +1,21 @@ error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +decl.d.ts(8,19): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. in1.d.ts(1,8): error TS2300: Duplicate identifier 'a'. in2.d.ts(1,8): error TS2300: Duplicate identifier 'a'. !!! error TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== decl.d.ts (0 errors) ==== +==== decl.d.ts (1 errors) ==== // bug 535531: duplicate identifier error reported for "import" declarations in separate files - declare module A + declare namespace A { class MyRoot { } - + export module B + ~ +!!! error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead. { class MyClass{ } } diff --git a/tests/baselines/reference/reachabilityChecks11.errors.txt b/tests/baselines/reference/reachabilityChecks11.errors.txt index b4497ee46432a..e93449cfa7bb3 100644 --- a/tests/baselines/reference/reachabilityChecks11.errors.txt +++ b/tests/baselines/reference/reachabilityChecks11.errors.txt @@ -10,24 +10,24 @@ reachabilityChecks11.ts(69,5): error TS7027: Unreachable code detected. // while (true); var x = 1; - module A { + namespace A { while (true); let x; ~~~~~~ !!! error TS7027: Unreachable code detected. } - module A1 { + namespace A1 { do {} while(true); - module A { + namespace A { interface F {} } } - module A2 { + namespace A2 { while (true); - module A { - ~~~~~~~~~~ + namespace A { + ~~~~~~~~~~~~~ var x = 1; ~~~~~~~~~~~~~~~~~~ } @@ -35,15 +35,15 @@ reachabilityChecks11.ts(69,5): error TS7027: Unreachable code detected. !!! error TS7027: Unreachable code detected. } - module A3 { + namespace A3 { while (true); type T = string; } - module A4 { + namespace A4 { while (true); - module A { - ~~~~~~~~~~ + namespace A { + ~~~~~~~~~~~~~ const enum E { X } ~~~~~~~~~~~~~~~~~~~~~~~~~~ } @@ -70,9 +70,9 @@ reachabilityChecks11.ts(69,5): error TS7027: Unreachable code detected. !!! error TS7027: Unreachable code detected. } - module B { + namespace B { for (; ;); - module C { + namespace C { } } diff --git a/tests/baselines/reference/reachabilityChecks11.js b/tests/baselines/reference/reachabilityChecks11.js index d115e58e816cb..7f0c08492355b 100644 --- a/tests/baselines/reference/reachabilityChecks11.js +++ b/tests/baselines/reference/reachabilityChecks11.js @@ -4,33 +4,33 @@ // while (true); var x = 1; -module A { +namespace A { while (true); let x; } -module A1 { +namespace A1 { do {} while(true); - module A { + namespace A { interface F {} } } -module A2 { +namespace A2 { while (true); - module A { + namespace A { var x = 1; } } -module A3 { +namespace A3 { while (true); type T = string; } -module A4 { +namespace A4 { while (true); - module A { + namespace A { const enum E { X } } } @@ -51,9 +51,9 @@ function f2() { } } -module B { +namespace B { for (; ;); - module C { + namespace C { } } diff --git a/tests/baselines/reference/reachabilityChecks11.symbols b/tests/baselines/reference/reachabilityChecks11.symbols index 450ccad803ff5..bb8868a67c355 100644 --- a/tests/baselines/reference/reachabilityChecks11.symbols +++ b/tests/baselines/reference/reachabilityChecks11.symbols @@ -5,7 +5,7 @@ var x = 1; >x : Symbol(x, Decl(reachabilityChecks11.ts, 1, 3)) -module A { +namespace A { >A : Symbol(A, Decl(reachabilityChecks11.ts, 1, 10)) while (true); @@ -13,23 +13,23 @@ module A { >x : Symbol(x, Decl(reachabilityChecks11.ts, 5, 7)) } -module A1 { +namespace A1 { >A1 : Symbol(A1, Decl(reachabilityChecks11.ts, 6, 1)) do {} while(true); - module A { + namespace A { >A : Symbol(A, Decl(reachabilityChecks11.ts, 9, 22)) interface F {} ->F : Symbol(F, Decl(reachabilityChecks11.ts, 10, 14)) +>F : Symbol(F, Decl(reachabilityChecks11.ts, 10, 17)) } } -module A2 { +namespace A2 { >A2 : Symbol(A2, Decl(reachabilityChecks11.ts, 13, 1)) while (true); - module A { + namespace A { >A : Symbol(A, Decl(reachabilityChecks11.ts, 16, 17)) var x = 1; @@ -37,7 +37,7 @@ module A2 { } } -module A3 { +namespace A3 { >A3 : Symbol(A3, Decl(reachabilityChecks11.ts, 20, 1)) while (true); @@ -45,15 +45,15 @@ module A3 { >T : Symbol(T, Decl(reachabilityChecks11.ts, 23, 17)) } -module A4 { +namespace A4 { >A4 : Symbol(A4, Decl(reachabilityChecks11.ts, 25, 1)) while (true); - module A { + namespace A { >A : Symbol(A, Decl(reachabilityChecks11.ts, 28, 17)) const enum E { X } ->E : Symbol(E, Decl(reachabilityChecks11.ts, 29, 14)) +>E : Symbol(E, Decl(reachabilityChecks11.ts, 29, 17)) >X : Symbol(E.X, Decl(reachabilityChecks11.ts, 30, 22)) } } @@ -84,11 +84,11 @@ function f2() { } } -module B { +namespace B { >B : Symbol(B, Decl(reachabilityChecks11.ts, 48, 1)) for (; ;); - module C { + namespace C { >C : Symbol(C, Decl(reachabilityChecks11.ts, 51, 14)) } } diff --git a/tests/baselines/reference/reachabilityChecks11.types b/tests/baselines/reference/reachabilityChecks11.types index 49fcc60359573..59400b55e7754 100644 --- a/tests/baselines/reference/reachabilityChecks11.types +++ b/tests/baselines/reference/reachabilityChecks11.types @@ -8,7 +8,7 @@ var x = 1; >1 : 1 > : ^ -module A { +namespace A { >A : typeof A > : ^^^^^^^^ @@ -21,7 +21,7 @@ module A { > : ^^^ } -module A1 { +namespace A1 { >A1 : typeof A1 > : ^^^^^^^^^ @@ -29,12 +29,12 @@ module A1 { >true : true > : ^^^^ - module A { + namespace A { interface F {} } } -module A2 { +namespace A2 { >A2 : typeof A2 > : ^^^^^^^^^ @@ -42,7 +42,7 @@ module A2 { >true : true > : ^^^^ - module A { + namespace A { >A : typeof A > : ^^^^^^^^ @@ -54,7 +54,7 @@ module A2 { } } -module A3 { +namespace A3 { >A3 : typeof A3 > : ^^^^^^^^^ @@ -67,7 +67,7 @@ module A3 { > : ^^^^^^ } -module A4 { +namespace A4 { >A4 : typeof A4 > : ^^^^^^^^^ @@ -75,7 +75,7 @@ module A4 { >true : true > : ^^^^ - module A { + namespace A { const enum E { X } >E : E > : ^ @@ -121,12 +121,12 @@ function f2() { } } -module B { +namespace B { >B : typeof B > : ^^^^^^^^ for (; ;); - module C { + namespace C { } } diff --git a/tests/baselines/reference/reachabilityChecksNoCrash1.errors.txt b/tests/baselines/reference/reachabilityChecksNoCrash1.errors.txt new file mode 100644 index 0000000000000..7caae70f67ddc --- /dev/null +++ b/tests/baselines/reference/reachabilityChecksNoCrash1.errors.txt @@ -0,0 +1,120 @@ +reachabilityChecksNoCrash1.ts(1,23): error TS7010: 'arrayFromAsync', which lacks return-type annotation, implicitly has an 'any' return type. +reachabilityChecksNoCrash1.ts(1,41): error TS7006: Parameter 'asyncIterable' implicitly has an 'any' type. +reachabilityChecksNoCrash1.ts(1,54): error TS2300: Duplicate identifier '(Missing)'. +reachabilityChecksNoCrash1.ts(1,54): error TS7006: Parameter '(Missing)' implicitly has an 'any' type. +reachabilityChecksNoCrash1.ts(1,54): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(1,55): error TS1138: Parameter declaration expected. +reachabilityChecksNoCrash1.ts(1,57): error TS7006: Parameter 'AsyncIterable' implicitly has an 'any' type. +reachabilityChecksNoCrash1.ts(1,70): error TS2300: Duplicate identifier '(Missing)'. +reachabilityChecksNoCrash1.ts(1,70): error TS7006: Parameter '(Missing)' implicitly has an 'any' type. +reachabilityChecksNoCrash1.ts(1,70): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(1,71): error TS7006: Parameter 'T' implicitly has an 'any' type. +reachabilityChecksNoCrash1.ts(1,72): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(1,73): error TS1109: Expression expected. +reachabilityChecksNoCrash1.ts(1,74): error TS1128: Declaration or statement expected. +reachabilityChecksNoCrash1.ts(1,76): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ const: any; for: any; of: any; asyncIterable: any; out: any; "": any; }'. +reachabilityChecksNoCrash1.ts(1,84): error TS2304: Cannot find name 'T'. +reachabilityChecksNoCrash1.ts(1,86): error TS1011: An element access expression should take an argument. +reachabilityChecksNoCrash1.ts(2,11): error TS1005: ':' expected. +reachabilityChecksNoCrash1.ts(2,11): error TS2304: Cannot find name 'out'. +reachabilityChecksNoCrash1.ts(2,19): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(3,9): error TS1005: ':' expected. +reachabilityChecksNoCrash1.ts(3,16): error TS1109: Expression expected. +reachabilityChecksNoCrash1.ts(3,22): error TS1005: ':' expected. +reachabilityChecksNoCrash1.ts(3,22): error TS2304: Cannot find name 'v'. +reachabilityChecksNoCrash1.ts(3,24): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(3,24): error TS18004: No value exists in scope for the shorthand property 'of'. Either declare one or provide an initializer. +reachabilityChecksNoCrash1.ts(3,27): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(3,27): error TS18004: No value exists in scope for the shorthand property 'asyncIterable'. Either declare one or provide an initializer. +reachabilityChecksNoCrash1.ts(3,40): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(3,42): error TS1136: Property assignment expected. +reachabilityChecksNoCrash1.ts(4,9): error TS18004: No value exists in scope for the shorthand property 'out'. Either declare one or provide an initializer. +reachabilityChecksNoCrash1.ts(4,12): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(4,24): error TS2304: Cannot find name 'v'. +reachabilityChecksNoCrash1.ts(4,26): error TS1005: ',' expected. +reachabilityChecksNoCrash1.ts(7,1): error TS1109: Expression expected. + + +==== reachabilityChecksNoCrash1.ts (35 errors) ==== + export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { + ~~~~~~~~~~~~~~ +!!! error TS7010: 'arrayFromAsync', which lacks return-type annotation, implicitly has an 'any' return type. + ~~~~~~~~~~~~~ +!!! error TS7006: Parameter 'asyncIterable' implicitly has an 'any' type. + +!!! error TS2300: Duplicate identifier '(Missing)'. + +!!! error TS7006: Parameter '(Missing)' implicitly has an 'any' type. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1138: Parameter declaration expected. + ~~~~~~~~~~~~~ +!!! error TS7006: Parameter 'AsyncIterable' implicitly has an 'any' type. + +!!! error TS2300: Duplicate identifier '(Missing)'. + +!!! error TS7006: Parameter '(Missing)' implicitly has an 'any' type. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS7006: Parameter 'T' implicitly has an 'any' type. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~ + ~ +!!! error TS2304: Cannot find name 'T'. + +!!! error TS1011: An element access expression should take an argument. + const out = []; + ~~~~~~~~~~~~~~~~~~~ + ~~~ +!!! error TS1005: ':' expected. + ~~~ +!!! error TS2304: Cannot find name 'out'. + ~ +!!! error TS1005: ',' expected. + for await (const v of asyncIterable) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS1005: ':' expected. + ~~~~~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2304: Cannot find name 'v'. + ~~ +!!! error TS1005: ',' expected. + ~~ +!!! error TS18004: No value exists in scope for the shorthand property 'of'. Either declare one or provide an initializer. + ~~~~~~~~~~~~~ +!!! error TS1005: ',' expected. + ~~~~~~~~~~~~~ +!!! error TS18004: No value exists in scope for the shorthand property 'asyncIterable'. Either declare one or provide an initializer. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1136: Property assignment expected. + out.push(await v); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ +!!! error TS18004: No value exists in scope for the shorthand property 'out'. Either declare one or provide an initializer. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS2304: Cannot find name 'v'. + ~ +!!! error TS1005: ',' expected. + } + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ const: any; for: any; of: any; asyncIterable: any; out: any; "": any; }'. + return out; + } + ~ +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecksNoCrash1.js b/tests/baselines/reference/reachabilityChecksNoCrash1.js new file mode 100644 index 0000000000000..1e901635972d8 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecksNoCrash1.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/reachabilityChecksNoCrash1.ts] //// + +//// [reachabilityChecksNoCrash1.ts] +export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { + const out = []; + for await (const v of asyncIterable) { + out.push(await v); + } + return out; +} + + +//// [reachabilityChecksNoCrash1.js] + > ; +Promise < T[] > { + const: out = [], + for: await (), const: v, of, asyncIterable, + out, : .push(await v) +}; +return out; +; +export {}; diff --git a/tests/baselines/reference/reachabilityChecksNoCrash1.symbols b/tests/baselines/reference/reachabilityChecksNoCrash1.symbols new file mode 100644 index 0000000000000..d7ed11171ad41 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecksNoCrash1.symbols @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/reachabilityChecksNoCrash1.ts] //// + +=== reachabilityChecksNoCrash1.ts === +export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { +>arrayFromAsync : Symbol(arrayFromAsync, Decl(reachabilityChecksNoCrash1.ts, 0, 0)) +>T : Symbol(T, Decl(reachabilityChecksNoCrash1.ts, 0, 37), Decl(reachabilityChecksNoCrash1.ts, 0, 70)) +>asyncIterable : Symbol(asyncIterable, Decl(reachabilityChecksNoCrash1.ts, 0, 40)) +> : Symbol((Missing), Decl(reachabilityChecksNoCrash1.ts, 0, 53)) +>AsyncIterable : Symbol(AsyncIterable, Decl(reachabilityChecksNoCrash1.ts, 0, 55)) +> : Symbol((Missing), Decl(reachabilityChecksNoCrash1.ts, 0, 69)) +>T : Symbol(T, Decl(reachabilityChecksNoCrash1.ts, 0, 37), Decl(reachabilityChecksNoCrash1.ts, 0, 70)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) + + const out = []; +>const : Symbol(const, Decl(reachabilityChecksNoCrash1.ts, 0, 89), Decl(reachabilityChecksNoCrash1.ts, 2, 15)) + + for await (const v of asyncIterable) { +>for : Symbol(for, Decl(reachabilityChecksNoCrash1.ts, 1, 19)) +>const : Symbol(const, Decl(reachabilityChecksNoCrash1.ts, 0, 89), Decl(reachabilityChecksNoCrash1.ts, 2, 15)) +>of : Symbol(of, Decl(reachabilityChecksNoCrash1.ts, 2, 22)) +>asyncIterable : Symbol(asyncIterable, Decl(reachabilityChecksNoCrash1.ts, 2, 25)) + + out.push(await v); +>out : Symbol(out, Decl(reachabilityChecksNoCrash1.ts, 2, 42)) +> : Symbol((Missing), Decl(reachabilityChecksNoCrash1.ts, 3, 11)) + } + return out; +} + diff --git a/tests/baselines/reference/reachabilityChecksNoCrash1.types b/tests/baselines/reference/reachabilityChecksNoCrash1.types new file mode 100644 index 0000000000000..83ef8c7caa191 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecksNoCrash1.types @@ -0,0 +1,90 @@ +//// [tests/cases/compiler/reachabilityChecksNoCrash1.ts] //// + +=== reachabilityChecksNoCrash1.ts === +export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { +>arrayFromAsync : (asyncIterable: any, : any, AsyncIterable: any, : any, T: any) => any +> : ^ ^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ +>asyncIterable : any +> : ^^^ +> : any +> : ^^^ +>AsyncIterable : any +> : ^^^ +> : any +> : ^^^ +>T : any +> : ^^^ +>> : boolean +> : ^^^^^^^ +> : any +> : ^^^ +> : any +> : ^^^ +>Promise { const out = []; for await (const v of asyncIterable) { out.push(await v); } : boolean +> : ^^^^^^^ +>Promise : ^^^^^^^ +>Promise : PromiseConstructor +> : ^^^^^^^^^^^^^^^^^^ +>T[] : any +> : ^^^ +>T : any +> : ^^^ +> : any +> : ^^^ +>{ const out = []; for await (const v of asyncIterable) { out.push(await v); } : { const: any; for: any; of: any; asyncIterable: any; out: any; "": any; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const out = []; +>const : never[] +> : ^^^^^^^ +>out = [] : never[] +> : ^^^^^^^ +>out : any +> : ^^^ +>[] : never[] +> : ^^^^^^^ + + for await (const v of asyncIterable) { +>for : any +> : ^^^ +>await ( : any +> : ^^^ +>( : any +> : ^^^ +> : any +> : ^^^ +>const : never[] +> : ^^^^^^^ +>v : any +> : ^^^ +>of : any +> : ^^^ +>asyncIterable : any +> : ^^^ + + out.push(await v); +>out : any +> : ^^^ +> : any +> : ^^^ +>.push(await v) : any +> : ^^^ +>.push : any +> : ^^^ +> : any +> : ^^^ +>push : any +> : ^^^ +>await v : any +> : ^^^ +>v : any +> : ^^^ + } + return out; +>out : any +> : ^^^ +} +> : any +> : ^^^ + diff --git a/tests/baselines/reference/recursiveCloduleReference.js b/tests/baselines/reference/recursiveCloduleReference.js index 3e53ee61fe4b7..312f4b97b0434 100644 --- a/tests/baselines/reference/recursiveCloduleReference.js +++ b/tests/baselines/reference/recursiveCloduleReference.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/recursiveCloduleReference.ts] //// //// [recursiveCloduleReference.ts] -module M +namespace M { export class C { } diff --git a/tests/baselines/reference/recursiveCloduleReference.symbols b/tests/baselines/reference/recursiveCloduleReference.symbols index cc8546973ada8..51e44627cf578 100644 --- a/tests/baselines/reference/recursiveCloduleReference.symbols +++ b/tests/baselines/reference/recursiveCloduleReference.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/recursiveCloduleReference.ts] //// === recursiveCloduleReference.ts === -module M +namespace M >M : Symbol(M, Decl(recursiveCloduleReference.ts, 0, 0)) { export class C { diff --git a/tests/baselines/reference/recursiveCloduleReference.types b/tests/baselines/reference/recursiveCloduleReference.types index 5c879dba45e9f..c257ab04ccb9a 100644 --- a/tests/baselines/reference/recursiveCloduleReference.types +++ b/tests/baselines/reference/recursiveCloduleReference.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/recursiveCloduleReference.ts] //// === recursiveCloduleReference.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 87a448e677a3f..b831151ee7922 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -1,7 +1,7 @@ -redefineArray.ts(1,1): error TS2739: Type '(n: number, s: string) => number' is missing the following properties from type 'ArrayConstructor': isArray, from, of, [Symbol.species] +redefineArray.ts(1,1): error TS2739: Type '(n: number, s: string) => number' is missing the following properties from type 'ArrayConstructor': isArray, from, of, [Symbol.species] ==== redefineArray.ts (1 errors) ==== Array = function (n:number, s:string) {return n;}; ~~~~~ -!!! error TS2739: Type '(n: number, s: string) => number' is missing the following properties from type 'ArrayConstructor': isArray, from, of, [Symbol.species] \ No newline at end of file +!!! error TS2739: Type '(n: number, s: string) => number' is missing the following properties from type 'ArrayConstructor': isArray, from, of, [Symbol.species] \ No newline at end of file diff --git a/tests/baselines/reference/redefineArray.types b/tests/baselines/reference/redefineArray.types index d4df39d46b393..221d20711fa31 100644 --- a/tests/baselines/reference/redefineArray.types +++ b/tests/baselines/reference/redefineArray.types @@ -2,12 +2,12 @@ === redefineArray.ts === Array = function (n:number, s:string) {return n;}; ->Array = function (n:number, s:string) {return n;} : (n: number, s: string) => number -> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ +>Array = function (n:number, s:string) {return n;} : (n: number, s: string) => number +> : ^ ^^ ^^ ^^ ^^^^^^^^^^^ >Array : ArrayConstructor > : ^^^^^^^^^^^^^^^^ ->function (n:number, s:string) {return n;} : (n: number, s: string) => number -> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ +>function (n:number, s:string) {return n;} : (n: number, s: string) => number +> : ^ ^^ ^^ ^^ ^^^^^^^^^^^ >n : number > : ^^^^^^ >s : string diff --git a/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.symbols b/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.symbols new file mode 100644 index 0000000000000..ef2a5fd660edc --- /dev/null +++ b/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.symbols @@ -0,0 +1,165 @@ +//// [tests/cases/compiler/returnTypeInferenceContextualParameterTypesInGenerator1.ts] //// + +=== returnTypeInferenceContextualParameterTypesInGenerator1.ts === +interface Effect { +>Effect : Symbol(Effect, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 0)) +>A : Symbol(A, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 17)) + + readonly _A: A; +>_A : Symbol(Effect._A, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 25)) +>A : Symbol(A, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 17)) +} + +declare function gen, AEff>( +>gen : Symbol(gen, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 2, 1)) +>Eff : Symbol(Eff, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 21)) +>Effect : Symbol(Effect, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 0)) +>AEff : Symbol(AEff, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 45)) + + f: () => Generator +>f : Symbol(f, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 52)) +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) +>Eff : Symbol(Eff, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 21)) +>AEff : Symbol(AEff, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 45)) + +): Effect; +>Effect : Symbol(Effect, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 0)) +>AEff : Symbol(AEff, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 4, 45)) + +interface Rpc< +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 6, 16)) + + in out Tag extends string, +>Tag : Symbol(Tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 8, 14)) + + out Payload = unknown, +>Payload : Symbol(Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 9, 28)) + + out Success = unknown +>Success : Symbol(Success, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 10, 24)) + +> { + readonly _tag: Tag; +>_tag : Symbol(Rpc._tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 12, 3)) +>Tag : Symbol(Tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 8, 14)) + + readonly payloadSchema: Payload; +>payloadSchema : Symbol(Rpc.payloadSchema, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 13, 21)) +>Payload : Symbol(Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 9, 28)) + + readonly successSchema: Success; +>successSchema : Symbol(Rpc.successSchema, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 14, 34)) +>Success : Symbol(Success, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 10, 24)) +} + +interface RpcAny { +>RpcAny : Symbol(RpcAny, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 16, 1)) + + readonly _tag: string; +>_tag : Symbol(RpcAny._tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 18, 18)) +} + +type Payload = R extends Rpc +>Payload : Symbol(Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 20, 1)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 13)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 13)) +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 6, 16)) +>_Tag : Symbol(_Tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 37)) +>_Payload : Symbol(_Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 49)) +>_Success : Symbol(_Success, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 65)) + + ? _Payload +>_Payload : Symbol(_Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 22, 49)) + + : never; + +type ResultFrom = R extends Rpc< +>ResultFrom : Symbol(ResultFrom, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 24, 10)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 26, 16)) +>RpcAny : Symbol(RpcAny, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 16, 1)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 26, 16)) +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 6, 16)) + + infer _Tag, +>_Tag : Symbol(_Tag, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 27, 7)) + + infer _Payload, +>_Payload : Symbol(_Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 28, 7)) + + infer _Success +>_Success : Symbol(_Success, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 29, 7)) + +> + ? _Success +>_Success : Symbol(_Success, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 29, 7)) + + : never; + +type ToHandlerFn = ( +>ToHandlerFn : Symbol(ToHandlerFn, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 32, 10)) +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 34, 17)) +>RpcAny : Symbol(RpcAny, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 16, 1)) + + payload: Payload +>payload : Symbol(payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 34, 44)) +>Payload : Symbol(Payload, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 20, 1)) +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 34, 17)) + +) => ResultFrom; +>ResultFrom : Symbol(ResultFrom, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 24, 10)) +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 34, 17)) + +type HandlersFrom = { +>HandlersFrom : Symbol(HandlersFrom, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 36, 25)) +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 38, 18)) +>RpcAny : Symbol(RpcAny, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 16, 1)) + + readonly [Current in Rpc as Current["_tag"]]: ToHandlerFn; +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 39, 12)) +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 38, 18)) +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 39, 12)) +>ToHandlerFn : Symbol(ToHandlerFn, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 32, 10)) +>Current : Symbol(Current, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 39, 12)) + +}; + +interface RpcGroup { +>RpcGroup : Symbol(RpcGroup, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 40, 2)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 42, 19)) +>RpcAny : Symbol(RpcAny, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 16, 1)) + + toLayer>(build: Effect): unknown; +>toLayer : Symbol(RpcGroup.toLayer, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 42, 45)) +>Handlers : Symbol(Handlers, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 43, 10)) +>HandlersFrom : Symbol(HandlersFrom, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 36, 25)) +>R : Symbol(R, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 42, 19)) +>build : Symbol(build, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 43, 44)) +>Effect : Symbol(Effect, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 0, 0)) +>Handlers : Symbol(Handlers, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 43, 10)) +} + +declare const Rpcs: RpcGroup>; +>Rpcs : Symbol(Rpcs, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 46, 13)) +>RpcGroup : Symbol(RpcGroup, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 40, 2)) +>Rpc : Symbol(Rpc, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 6, 16)) + +export const layerServerHandlers = Rpcs.toLayer( +>layerServerHandlers : Symbol(layerServerHandlers, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 48, 12)) +>Rpcs.toLayer : Symbol(RpcGroup.toLayer, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 42, 45)) +>Rpcs : Symbol(Rpcs, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 46, 13)) +>toLayer : Symbol(RpcGroup.toLayer, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 42, 45)) + + gen(function* () { +>gen : Symbol(gen, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 2, 1)) + + return { + Register: (id) => String(id), +>Register : Symbol(Register, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 50, 12)) +>id : Symbol(id, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 51, 17)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 7 more) +>id : Symbol(id, Decl(returnTypeInferenceContextualParameterTypesInGenerator1.ts, 51, 17)) + + }; + }) +); + diff --git a/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.types b/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.types new file mode 100644 index 0000000000000..71a5b114a505e --- /dev/null +++ b/tests/baselines/reference/returnTypeInferenceContextualParameterTypesInGenerator1.types @@ -0,0 +1,136 @@ +//// [tests/cases/compiler/returnTypeInferenceContextualParameterTypesInGenerator1.ts] //// + +=== Performance Stats === +Type Count: 1,000 +Instantiation count: 2,500 + +=== returnTypeInferenceContextualParameterTypesInGenerator1.ts === +interface Effect { + readonly _A: A; +>_A : A +> : ^ +} + +declare function gen, AEff>( +>gen : , AEff>(f: () => Generator) => Effect +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ + + f: () => Generator +>f : () => Generator +> : ^^^^^^ + +): Effect; + +interface Rpc< + in out Tag extends string, + out Payload = unknown, + out Success = unknown +> { + readonly _tag: Tag; +>_tag : Tag +> : ^^^ + + readonly payloadSchema: Payload; +>payloadSchema : Payload +> : ^^^^^^^ + + readonly successSchema: Success; +>successSchema : Success +> : ^^^^^^^ +} + +interface RpcAny { + readonly _tag: string; +>_tag : string +> : ^^^^^^ +} + +type Payload = R extends Rpc +>Payload : Payload +> : ^^^^^^^^^^ + + ? _Payload + : never; + +type ResultFrom = R extends Rpc< +>ResultFrom : ResultFrom +> : ^^^^^^^^^^^^^ + + infer _Tag, + infer _Payload, + infer _Success +> + ? _Success + : never; + +type ToHandlerFn = ( +>ToHandlerFn : ToHandlerFn +> : ^^^^^^^^^^^^^^^^^^^^ + + payload: Payload +>payload : Payload +> : ^^^^^^^^^^^^^^^^ + +) => ResultFrom; + +type HandlersFrom = { +>HandlersFrom : HandlersFrom +> : ^^^^^^^^^^^^^^^^^ + + readonly [Current in Rpc as Current["_tag"]]: ToHandlerFn; +}; + +interface RpcGroup { + toLayer>(build: Effect): unknown; +>toLayer : >(build: Effect) => unknown +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>build : Effect +> : ^^^^^^^^^^^^^^^^ +} + +declare const Rpcs: RpcGroup>; +>Rpcs : RpcGroup> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const layerServerHandlers = Rpcs.toLayer( +>layerServerHandlers : unknown +> : ^^^^^^^ +>Rpcs.toLayer( gen(function* () { return { Register: (id) => String(id), }; })) : unknown +> : ^^^^^^^ +>Rpcs.toLayer : >>(build: Effect) => unknown +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ +>Rpcs : RpcGroup> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>toLayer : >>(build: Effect) => unknown +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ + + gen(function* () { +>gen(function* () { return { Register: (id) => String(id), }; }) : Effect<{ Register: (id: number) => string; }> +> : ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ +>gen : , AEff>(f: () => Generator) => Effect +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +>function* () { return { Register: (id) => String(id), }; } : () => Generator string; }, any> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ Register: (id) => String(id), } : { Register: (id: number) => string; } +> : ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + Register: (id) => String(id), +>Register : (id: number) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>(id) => String(id) : (id: number) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>id : number +> : ^^^^^^ +>String(id) : string +> : ^^^^^^ +>String : StringConstructor +> : ^^^^^^^^^^^^^^^^^ +>id : number +> : ^^^^^^ + + }; + }) +); + diff --git a/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.symbols b/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.symbols new file mode 100644 index 0000000000000..9f787b05bad1b --- /dev/null +++ b/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.symbols @@ -0,0 +1,85 @@ +//// [tests/cases/compiler/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts] //// + +=== returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts === +declare function outer1(arg: { prop: any }): void; +>outer1 : Symbol(outer1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 0)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 24)) +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 30)) + +declare function outer2(arg: { prop: unknown }): void; +>outer2 : Symbol(outer2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 50)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 24)) +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 30)) + +declare function inner1 any>(arg: T): T; +>inner1 : Symbol(inner1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 54)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 3, 24)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 3, 35)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 3, 56)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 3, 24)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 3, 24)) + +const result1 = inner1((arg) => arg); +>result1 : Symbol(result1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 5, 5)) +>inner1 : Symbol(inner1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 54)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 5, 24)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 5, 24)) + +outer1({ +>outer1 : Symbol(outer1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 0)) + + prop: inner1((arg) => arg), +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 7, 8)) +>inner1 : Symbol(inner1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 54)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 8, 16)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 8, 16)) + +}); + +outer2({ +>outer2 : Symbol(outer2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 50)) + + prop: inner1((arg) => arg), +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 11, 8)) +>inner1 : Symbol(inner1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 1, 54)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 12, 16)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 12, 16)) + +}); + +declare function inner2(arg: T & ((arg: string) => any)): T; +>inner2 : Symbol(inner2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 13, 3)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 15, 24)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 15, 27)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 15, 24)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 15, 38)) +>T : Symbol(T, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 15, 24)) + +const result2 = inner2((arg) => arg); +>result2 : Symbol(result2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 17, 5)) +>inner2 : Symbol(inner2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 13, 3)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 17, 24)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 17, 24)) + +outer1({ +>outer1 : Symbol(outer1, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 0)) + + prop: inner2((arg) => arg), +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 19, 8)) +>inner2 : Symbol(inner2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 13, 3)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 20, 16)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 20, 16)) + +}); + +outer2({ +>outer2 : Symbol(outer2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 0, 50)) + + prop: inner2((arg) => arg), +>prop : Symbol(prop, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 23, 8)) +>inner2 : Symbol(inner2, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 13, 3)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 24, 16)) +>arg : Symbol(arg, Decl(returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts, 24, 16)) + +}); + diff --git a/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.types b/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.types new file mode 100644 index 0000000000000..298ea70a69e42 --- /dev/null +++ b/tests/baselines/reference/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.types @@ -0,0 +1,158 @@ +//// [tests/cases/compiler/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts] //// + +=== returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts === +declare function outer1(arg: { prop: any }): void; +>outer1 : (arg: { prop: any; }) => void +> : ^ ^^ ^^^^^ +>arg : { prop: any; } +> : ^^^^^^^^ ^^^ +>prop : any + +declare function outer2(arg: { prop: unknown }): void; +>outer2 : (arg: { prop: unknown; }) => void +> : ^ ^^ ^^^^^ +>arg : { prop: unknown; } +> : ^^^^^^^^ ^^^ +>prop : unknown +> : ^^^^^^^ + +declare function inner1 any>(arg: T): T; +>inner1 : any>(arg: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>arg : string +> : ^^^^^^ +>arg : T +> : ^ + +const result1 = inner1((arg) => arg); +>result1 : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1 : any>(arg: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +outer1({ +>outer1({ prop: inner1((arg) => arg),}) : void +> : ^^^^ +>outer1 : (arg: { prop: any; }) => void +> : ^ ^^ ^^^^^ +>{ prop: inner1((arg) => arg),} : { prop: (arg: string) => string; } +> : ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + prop: inner1((arg) => arg), +>prop : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1 : any>(arg: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +}); + +outer2({ +>outer2({ prop: inner1((arg) => arg),}) : void +> : ^^^^ +>outer2 : (arg: { prop: unknown; }) => void +> : ^ ^^ ^^^^^ +>{ prop: inner1((arg) => arg),} : { prop: (arg: string) => string; } +> : ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + prop: inner1((arg) => arg), +>prop : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner1 : any>(arg: T) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +}); + +declare function inner2(arg: T & ((arg: string) => any)): T; +>inner2 : (arg: T & ((arg: string) => any)) => T +> : ^ ^^ ^^ ^^^^^ +>arg : T & ((arg: string) => any) +> : ^^^^^^ ^^ ^^^^^ ^ +>arg : string +> : ^^^^^^ + +const result2 = inner2((arg) => arg); +>result2 : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2 : (arg: T & ((arg: string) => any)) => T +> : ^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +outer1({ +>outer1({ prop: inner2((arg) => arg),}) : void +> : ^^^^ +>outer1 : (arg: { prop: any; }) => void +> : ^ ^^ ^^^^^ +>{ prop: inner2((arg) => arg),} : { prop: (arg: string) => string; } +> : ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + prop: inner2((arg) => arg), +>prop : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2 : (arg: T & ((arg: string) => any)) => T +> : ^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +}); + +outer2({ +>outer2({ prop: inner2((arg) => arg),}) : void +> : ^^^^ +>outer2 : (arg: { prop: unknown; }) => void +> : ^ ^^ ^^^^^ +>{ prop: inner2((arg) => arg),} : { prop: (arg: string) => string; } +> : ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + prop: inner2((arg) => arg), +>prop : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2((arg) => arg) : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>inner2 : (arg: T & ((arg: string) => any)) => T +> : ^ ^^ ^^ ^^^^^ +>(arg) => arg : (arg: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>arg : string +> : ^^^^^^ +>arg : string +> : ^^^^^^ + +}); + diff --git a/tests/baselines/reference/reverseMappedTypeInferenceWidening1.symbols b/tests/baselines/reference/reverseMappedTypeInferenceWidening1.symbols new file mode 100644 index 0000000000000..635dcd0afed7d --- /dev/null +++ b/tests/baselines/reference/reverseMappedTypeInferenceWidening1.symbols @@ -0,0 +1,181 @@ +//// [tests/cases/compiler/reverseMappedTypeInferenceWidening1.ts] //// + +=== reverseMappedTypeInferenceWidening1.ts === +// https://github.com/microsoft/TypeScript/issues/62720 + +type TypeFunction = (...args: any[]) => ReturnType; +>TypeFunction : Symbol(TypeFunction, Decl(reverseMappedTypeInferenceWidening1.ts, 0, 0)) +>ReturnType : Symbol(ReturnType, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 18)) +>args : Symbol(args, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 43)) +>ReturnType : Symbol(ReturnType, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 18)) + +type Flags = { +>Flags : Symbol(Flags, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 73)) + + [flagName: string]: { +>flagName : Symbol(flagName, Decl(reverseMappedTypeInferenceWidening1.ts, 4, 3)) + + type: TypeFunction; +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 4, 23)) +>TypeFunction : Symbol(TypeFunction, Decl(reverseMappedTypeInferenceWidening1.ts, 0, 0)) + + default?: unknown; +>default : Symbol(default, Decl(reverseMappedTypeInferenceWidening1.ts, 5, 23)) + + }; +}; +type TypeFlag = { +>TypeFlag : Symbol(TypeFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 8, 2)) +>Schemas : Symbol(Schemas, Decl(reverseMappedTypeInferenceWidening1.ts, 9, 14)) +>Flags : Symbol(Flags, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 73)) + + [flag in keyof Schemas]: Schemas[flag] extends { type: TypeFunction } +>flag : Symbol(flag, Decl(reverseMappedTypeInferenceWidening1.ts, 10, 3)) +>Schemas : Symbol(Schemas, Decl(reverseMappedTypeInferenceWidening1.ts, 9, 14)) +>Schemas : Symbol(Schemas, Decl(reverseMappedTypeInferenceWidening1.ts, 9, 14)) +>flag : Symbol(flag, Decl(reverseMappedTypeInferenceWidening1.ts, 10, 3)) +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 10, 50)) +>TypeFunction : Symbol(TypeFunction, Decl(reverseMappedTypeInferenceWidening1.ts, 0, 0)) +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening1.ts, 10, 75)) + + ? T +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening1.ts, 10, 75)) + + : never; +}; + +declare function fn1( +>fn1 : Symbol(fn1, Decl(reverseMappedTypeInferenceWidening1.ts, 13, 2)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 15, 21)) +>Flags : Symbol(Flags, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 73)) + + options: Options, +>options : Symbol(options, Decl(reverseMappedTypeInferenceWidening1.ts, 15, 44)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 15, 21)) + +): TypeFlag; +>TypeFlag : Symbol(TypeFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 8, 2)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 15, 21)) + +const result1 = fn1({ +>result1 : Symbol(result1, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 5)) +>fn1 : Symbol(fn1, Decl(reverseMappedTypeInferenceWidening1.ts, 13, 2)) + + booleanFlag: { type: Boolean }, +>booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 21)) +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 20, 16)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + booleanFlagDefault: { +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 20, 33)) + + type: Boolean, +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 21, 23)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + default: false, +>default : Symbol(default, Decl(reverseMappedTypeInferenceWidening1.ts, 22, 18)) + + }, +}); +result1.booleanFlag; // boolean +>result1.booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 21)) +>result1 : Symbol(result1, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 5)) +>booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 21)) + +result1.booleanFlagDefault; // boolean +>result1.booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 20, 33)) +>result1 : Symbol(result1, Decl(reverseMappedTypeInferenceWidening1.ts, 19, 5)) +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 20, 33)) + +declare function fn2( +>fn2 : Symbol(fn2, Decl(reverseMappedTypeInferenceWidening1.ts, 27, 27)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 29, 21)) +>Flags : Symbol(Flags, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 73)) + + options: Readonly, +>options : Symbol(options, Decl(reverseMappedTypeInferenceWidening1.ts, 29, 44)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 29, 21)) + +): TypeFlag; +>TypeFlag : Symbol(TypeFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 8, 2)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 29, 21)) + +const result2 = fn2({ +>result2 : Symbol(result2, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 5)) +>fn2 : Symbol(fn2, Decl(reverseMappedTypeInferenceWidening1.ts, 27, 27)) + + booleanFlag: { type: Boolean }, +>booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 21)) +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 34, 16)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + booleanFlagDefault: { +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 34, 33)) + + type: Boolean, +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 35, 23)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + default: false, +>default : Symbol(default, Decl(reverseMappedTypeInferenceWidening1.ts, 36, 18)) + + }, +}); +result2.booleanFlag; // boolean +>result2.booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 21)) +>result2 : Symbol(result2, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 5)) +>booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 21)) + +result2.booleanFlagDefault; // boolean +>result2.booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 34, 33)) +>result2 : Symbol(result2, Decl(reverseMappedTypeInferenceWidening1.ts, 33, 5)) +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 34, 33)) + +declare function fn3( +>fn3 : Symbol(fn3, Decl(reverseMappedTypeInferenceWidening1.ts, 41, 27)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 43, 21)) +>Flags : Symbol(Flags, Decl(reverseMappedTypeInferenceWidening1.ts, 2, 73)) + + options: Readonly, +>options : Symbol(options, Decl(reverseMappedTypeInferenceWidening1.ts, 43, 44)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 43, 21)) + +): Options; +>Options : Symbol(Options, Decl(reverseMappedTypeInferenceWidening1.ts, 43, 21)) + +const result3 = fn3({ +>result3 : Symbol(result3, Decl(reverseMappedTypeInferenceWidening1.ts, 47, 5)) +>fn3 : Symbol(fn3, Decl(reverseMappedTypeInferenceWidening1.ts, 41, 27)) + + booleanFlag: { type: Boolean }, +>booleanFlag : Symbol(booleanFlag, Decl(reverseMappedTypeInferenceWidening1.ts, 47, 21)) +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 48, 16)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + booleanFlagDefault: { +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 48, 33)) + + type: Boolean, +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 49, 23)) +>Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + default: false, // no cursed EPC failure here +>default : Symbol(default, Decl(reverseMappedTypeInferenceWidening1.ts, 50, 18)) + + }, +}); + +declare function takeType(arg: { type: unknown }): void; +>takeType : Symbol(takeType, Decl(reverseMappedTypeInferenceWidening1.ts, 53, 3)) +>arg : Symbol(arg, Decl(reverseMappedTypeInferenceWidening1.ts, 55, 26)) +>type : Symbol(type, Decl(reverseMappedTypeInferenceWidening1.ts, 55, 32)) + +takeType(result3.booleanFlagDefault); +>takeType : Symbol(takeType, Decl(reverseMappedTypeInferenceWidening1.ts, 53, 3)) +>result3.booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 48, 33)) +>result3 : Symbol(result3, Decl(reverseMappedTypeInferenceWidening1.ts, 47, 5)) +>booleanFlagDefault : Symbol(booleanFlagDefault, Decl(reverseMappedTypeInferenceWidening1.ts, 48, 33)) + diff --git a/tests/baselines/reference/reverseMappedTypeInferenceWidening1.types b/tests/baselines/reference/reverseMappedTypeInferenceWidening1.types new file mode 100644 index 0000000000000..f8001f76ebe68 --- /dev/null +++ b/tests/baselines/reference/reverseMappedTypeInferenceWidening1.types @@ -0,0 +1,244 @@ +//// [tests/cases/compiler/reverseMappedTypeInferenceWidening1.ts] //// + +=== reverseMappedTypeInferenceWidening1.ts === +// https://github.com/microsoft/TypeScript/issues/62720 + +type TypeFunction = (...args: any[]) => ReturnType; +>TypeFunction : TypeFunction +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>args : any[] +> : ^^^^^ + +type Flags = { +>Flags : Flags +> : ^^^^^ + + [flagName: string]: { +>flagName : string +> : ^^^^^^ + + type: TypeFunction; +>type : TypeFunction +> : ^^^^^^^^^^^^^^^^^^^^^ + + default?: unknown; +>default : unknown +> : ^^^^^^^ + + }; +}; +type TypeFlag = { +>TypeFlag : TypeFlag +> : ^^^^^^^^^^^^^^^^^ + + [flag in keyof Schemas]: Schemas[flag] extends { type: TypeFunction } +>type : TypeFunction +> : ^^^^^^^^^^^^^^^ + + ? T + : never; +}; + +declare function fn1( +>fn1 : (options: Options) => TypeFlag +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + options: Options, +>options : Options +> : ^^^^^^^ + +): TypeFlag; + +const result1 = fn1({ +>result1 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn1({ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, },}) : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn1 : (options: Options) => TypeFlag +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, },} : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: false; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + booleanFlag: { type: Boolean }, +>booleanFlag : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean } : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + booleanFlagDefault: { +>booleanFlagDefault : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean, default: false, } : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + type: Boolean, +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + default: false, +>default : false +> : ^^^^^ +>false : false +> : ^^^^^ + + }, +}); +result1.booleanFlag; // boolean +>result1.booleanFlag : boolean +> : ^^^^^^^ +>result1 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>booleanFlag : boolean +> : ^^^^^^^ + +result1.booleanFlagDefault; // boolean +>result1.booleanFlagDefault : boolean +> : ^^^^^^^ +>result1 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>booleanFlagDefault : boolean +> : ^^^^^^^ + +declare function fn2( +>fn2 : (options: Readonly) => TypeFlag +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + options: Readonly, +>options : Readonly +> : ^^^^^^^^^^^^^^^^^ + +): TypeFlag; + +const result2 = fn2({ +>result2 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn2({ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, },}) : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn2 : (options: Readonly) => TypeFlag +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, },} : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: false; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + booleanFlag: { type: Boolean }, +>booleanFlag : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean } : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + booleanFlagDefault: { +>booleanFlagDefault : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean, default: false, } : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + type: Boolean, +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + default: false, +>default : false +> : ^^^^^ +>false : false +> : ^^^^^ + + }, +}); +result2.booleanFlag; // boolean +>result2.booleanFlag : boolean +> : ^^^^^^^ +>result2 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>booleanFlag : boolean +> : ^^^^^^^ + +result2.booleanFlagDefault; // boolean +>result2.booleanFlagDefault : boolean +> : ^^^^^^^ +>result2 : TypeFlag<{ booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>booleanFlagDefault : boolean +> : ^^^^^^^ + +declare function fn3( +>fn3 : (options: Readonly) => Options +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + options: Readonly, +>options : Readonly +> : ^^^^^^^^^^^^^^^^^ + +): Options; + +const result3 = fn3({ +>result3 : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn3({ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, // no cursed EPC failure here },}) : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn3 : (options: Readonly) => Options +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ booleanFlag: { type: Boolean }, booleanFlagDefault: { type: Boolean, default: false, // no cursed EPC failure here },} : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: false; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + booleanFlag: { type: Boolean }, +>booleanFlag : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean } : { type: BooleanConstructor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + booleanFlagDefault: { +>booleanFlagDefault : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ type: Boolean, default: false, // no cursed EPC failure here } : { type: BooleanConstructor; default: false; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + type: Boolean, +>type : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ +>Boolean : BooleanConstructor +> : ^^^^^^^^^^^^^^^^^^ + + default: false, // no cursed EPC failure here +>default : false +> : ^^^^^ +>false : false +> : ^^^^^ + + }, +}); + +declare function takeType(arg: { type: unknown }): void; +>takeType : (arg: { type: unknown; }) => void +> : ^ ^^ ^^^^^ +>arg : { type: unknown; } +> : ^^^^^^^^ ^^^ +>type : unknown +> : ^^^^^^^ + +takeType(result3.booleanFlagDefault); +>takeType(result3.booleanFlagDefault) : void +> : ^^^^ +>takeType : (arg: { type: unknown; }) => void +> : ^ ^^ ^^^^^ +>result3.booleanFlagDefault : { type: BooleanConstructor; default: boolean; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>result3 : { booleanFlag: { type: BooleanConstructor; }; booleanFlagDefault: { type: BooleanConstructor; default: boolean; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>booleanFlagDefault : { type: BooleanConstructor; default: boolean; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/reverseMappedTypeInferenceWidening2.symbols b/tests/baselines/reference/reverseMappedTypeInferenceWidening2.symbols new file mode 100644 index 0000000000000..a8a620769f1e2 --- /dev/null +++ b/tests/baselines/reference/reverseMappedTypeInferenceWidening2.symbols @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/reverseMappedTypeInferenceWidening2.ts] //// + +=== reverseMappedTypeInferenceWidening2.ts === +declare function test1>(arg: { +>test1 : Symbol(test1, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 0)) +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 23)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>prop : Symbol(prop, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 49)) +>arg : Symbol(arg, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 68)) + + [K in keyof T]: T[K]; +>K : Symbol(K, Decl(reverseMappedTypeInferenceWidening2.ts, 1, 3)) +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 23)) +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 23)) +>K : Symbol(K, Decl(reverseMappedTypeInferenceWidening2.ts, 1, 3)) + +}): T; +>T : Symbol(T, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 23)) + +const res1 = test1({ +>res1 : Symbol(res1, Decl(reverseMappedTypeInferenceWidening2.ts, 4, 5)) +>test1 : Symbol(test1, Decl(reverseMappedTypeInferenceWidening2.ts, 0, 0)) + + foo: { +>foo : Symbol(foo, Decl(reverseMappedTypeInferenceWidening2.ts, 4, 20)) + + prop: 1, +>prop : Symbol(prop, Decl(reverseMappedTypeInferenceWidening2.ts, 5, 8)) + + prop2: "", +>prop2 : Symbol(prop2, Decl(reverseMappedTypeInferenceWidening2.ts, 6, 12)) + + }, + bar: { +>bar : Symbol(bar, Decl(reverseMappedTypeInferenceWidening2.ts, 8, 4)) + + prop: true, +>prop : Symbol(prop, Decl(reverseMappedTypeInferenceWidening2.ts, 9, 8)) + + prop2: null, +>prop2 : Symbol(prop2, Decl(reverseMappedTypeInferenceWidening2.ts, 10, 15)) + + }, +}); + diff --git a/tests/baselines/reference/reverseMappedTypeInferenceWidening2.types b/tests/baselines/reference/reverseMappedTypeInferenceWidening2.types new file mode 100644 index 0000000000000..347e19be45f4f --- /dev/null +++ b/tests/baselines/reference/reverseMappedTypeInferenceWidening2.types @@ -0,0 +1,62 @@ +//// [tests/cases/compiler/reverseMappedTypeInferenceWidening2.ts] //// + +=== reverseMappedTypeInferenceWidening2.ts === +declare function test1>(arg: { +>test1 : >(arg: { [K in keyof T]: T[K]; }) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>prop : unknown +> : ^^^^^^^ +>arg : { [K in keyof T]: T[K]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ + + [K in keyof T]: T[K]; +}): T; + +const res1 = test1({ +>res1 : { foo: { prop: number; prop2: string; }; bar: { prop: boolean; prop2: null; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>test1({ foo: { prop: 1, prop2: "", }, bar: { prop: true, prop2: null, },}) : { foo: { prop: number; prop2: string; }; bar: { prop: boolean; prop2: null; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>test1 : >(arg: { [K in keyof T]: T[K]; }) => T +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ foo: { prop: 1, prop2: "", }, bar: { prop: true, prop2: null, },} : { foo: { prop: number; prop2: string; }; bar: { prop: true; prop2: null; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + foo: { +>foo : { prop: number; prop2: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ prop: 1, prop2: "", } : { prop: number; prop2: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + prop: 1, +>prop : number +> : ^^^^^^ +>1 : 1 +> : ^ + + prop2: "", +>prop2 : string +> : ^^^^^^ +>"" : "" +> : ^^ + + }, + bar: { +>bar : { prop: true; prop2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ prop: true, prop2: null, } : { prop: true; prop2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + prop: true, +>prop : true +> : ^^^^ +>true : true +> : ^^^^ + + prop2: null, +>prop2 : null +> : ^^^^ + + }, +}); + diff --git a/tests/baselines/reference/selfRef.errors.txt b/tests/baselines/reference/selfRef.errors.txt index 37bdaf9700b52..e4b5edd820f13 100644 --- a/tests/baselines/reference/selfRef.errors.txt +++ b/tests/baselines/reference/selfRef.errors.txt @@ -3,7 +3,7 @@ selfRef.ts(12,18): error TS2304: Cannot find name 'name'. ==== selfRef.ts (2 errors) ==== - module M + namespace M { export class Test { diff --git a/tests/baselines/reference/selfRef.js b/tests/baselines/reference/selfRef.js index 4ff5e6d6fa118..31a7e338041a8 100644 --- a/tests/baselines/reference/selfRef.js +++ b/tests/baselines/reference/selfRef.js @@ -1,7 +1,7 @@ //// [tests/cases/compiler/selfRef.ts] //// //// [selfRef.ts] -module M +namespace M { export class Test { diff --git a/tests/baselines/reference/selfRef.symbols b/tests/baselines/reference/selfRef.symbols index 75a9b2457ed21..088fa3304b8b8 100644 --- a/tests/baselines/reference/selfRef.symbols +++ b/tests/baselines/reference/selfRef.symbols @@ -1,7 +1,7 @@ //// [tests/cases/compiler/selfRef.ts] //// === selfRef.ts === -module M +namespace M >M : Symbol(M, Decl(selfRef.ts, 0, 0)) { export class Test diff --git a/tests/baselines/reference/selfRef.types b/tests/baselines/reference/selfRef.types index adaf914b5348d..c6eddd052ef57 100644 --- a/tests/baselines/reference/selfRef.types +++ b/tests/baselines/reference/selfRef.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/selfRef.ts] //// === selfRef.ts === -module M +namespace M >M : typeof M > : ^^^^^^^^ { diff --git a/tests/baselines/reference/thisTypeInFunctions.types b/tests/baselines/reference/thisTypeInFunctions.types index 1f704de6562eb..26dbe2202d918 100644 --- a/tests/baselines/reference/thisTypeInFunctions.types +++ b/tests/baselines/reference/thisTypeInFunctions.types @@ -203,8 +203,8 @@ function implicitThis(n: number): number { let impl: I = { >impl : I > : ^ ->{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: number; explicitVoid2: () => any; explicitVoid1(this: void): number; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: number; explicitVoid2: () => any; explicitVoid1(): number; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ a: 12, >a : number @@ -225,8 +225,8 @@ let impl: I = { > : ^^^ explicitVoid1() { return 12; }, ->explicitVoid1 : (this: void) => number -> : ^ ^^ ^^^^^^^^^^^ +>explicitVoid1 : () => number +> : ^^^^^^^^^^^^ >12 : 12 > : ^^ @@ -271,16 +271,16 @@ let impl: I = { }, } impl.explicitVoid1 = function () { return 12; }; ->impl.explicitVoid1 = function () { return 12; } : (this: void) => number -> : ^ ^^ ^^^^^^^^^^^ +>impl.explicitVoid1 = function () { return 12; } : () => number +> : ^^^^^^^^^^^^ >impl.explicitVoid1 : (this: void) => number > : ^ ^^ ^^^^^ >impl : I > : ^ >explicitVoid1 : (this: void) => number > : ^ ^^ ^^^^^ ->function () { return 12; } : (this: void) => number -> : ^ ^^ ^^^^^^^^^^^ +>function () { return 12; } : () => number +> : ^^^^^^^^^^^^ >12 : 12 > : ^^ @@ -736,8 +736,8 @@ let anyToSpecified: (this: { y: number }, x: number) => number = function(x: num > : ^^^^^^ >x : number > : ^^^^^^ ->function(x: number): number { return x + 12; } : (this: { y: number; }, x: number) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>function(x: number): number { return x + 12; } : (x: number) => number +> : ^ ^^ ^^^^^ >x : number > : ^^^^^^ >x + 12 : number diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive1.errors.txt b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.errors.txt new file mode 100644 index 0000000000000..f3ad16d09ea13 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.errors.txt @@ -0,0 +1,252 @@ +thislessFunctionsNotContextSensitive1.ts(25,3): error TS2345: Argument of type 'false' is not assignable to parameter of type 'true'. +thislessFunctionsNotContextSensitive1.ts(143,13): error TS2345: Argument of type '"value"' is not assignable to parameter of type 'never'. +thislessFunctionsNotContextSensitive1.ts(176,3): error TS2820: Type '"$test6"' is not assignable to type 'ExtractFields<{ target: "$test6"; data1: { $test1: number; $test2: null; }; data2: { $test3: {}; $test4: () => void; $test5(): void; }; }> | undefined'. Did you mean '"$test4"'? + + +==== thislessFunctionsNotContextSensitive1.ts (3 errors) ==== + // https://github.com/microsoft/TypeScript/issues/62204 + + declare function TestConfig( + config: TConfig, + test: keyof Omit extends never ? true : false, + ): void; + + TestConfig( + { + a: "hello", + b: function () { + return 123; + }, + }, + true, + ); + + TestConfig( + { + a: "hello", + b: function () { + return 123; + }, + }, + false, // error + ~~~~~ +!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'true'. + ); + + // https://github.com/microsoft/TypeScript/issues/60986 + interface SubscribeFieldOptions { + subscribe: () => Event; + resolve: (event: Event) => number; + } + + declare function defineOptions( + options: SubscribeFieldOptions, + ): void; + + defineOptions({ + resolve: (event) => event, // number + subscribe() { + return 123; + }, + }); + + defineOptions({ + resolve: (event) => event, // number + subscribe: function () { + return 123; + }, + }); + + // https://github.com/microsoft/TypeScript/issues/58630 + + export type StateFunction = (s: State, ...args: any[]) => any; + + export type VuexStoreOptions = { + state?: State | (() => State) | { (): State }; + mutations?: Record>; + modules?: { + [k in keyof Modules]: VuexStoreOptions; + }; + }; + + export function createStore< + State extends Record, + Modules extends Record>, + >(options: VuexStoreOptions) {} + + const store = createStore({ + state() { + return { bar2: 1 }; + }, + mutations: { inc: (state123) => state123.bar2++ }, + modules: { + foo: { + state() { + return { bar2: 1 }; + }, + mutations: { inc: (state) => state.bar2++ }, + }, + }, + }); + + // https://github.com/microsoft/TypeScript/issues/57572 + + type C = void>(options: { + methods: Methods; + attached: Attached; + }) => any; + + var Component: C = () => {}; + + Component({ + attached(methods) { + methods.bbb(); // ok + }, + methods: { + bbb() {}, + }, + }); + + Component({ + attached(methods) { + methods.bbb(); // ok + }, + methods: { + bbb: () => {}, + }, + }); + + // https://github.com/microsoft/TypeScript/issues/56067 + + declare function create56067< + State extends Record, + Data extends Record, + Actions extends (state: State, data: Data) => Record, + >(args: { getState: () => State; actions: Actions; getData: () => Data }): void; + + create56067({ + getState() { + return { a: 1 }; + }, + getData: () => { + return { b: 2 }; + }, + actions(state, data) { + state // { a: number } + data; // { b: number } + return { + z: 1, + }; + }, + }); + + // https://github.com/microsoft/TypeScript/issues/55489 + type NonStringIterable = + T extends string ? never : T extends Iterable ? T : never; + + declare function doSomething(value: NonStringIterable): T; + + const o = { foo() {} }; + + doSomething('value'); // error + ~~~~~~~ +!!! error TS2345: Argument of type '"value"' is not assignable to parameter of type 'never'. + doSomething(['v']); // ok + doSomething([o]); // ok + doSomething([{ foo() {} }]); // ok + + // https://github.com/microsoft/TypeScript/issues/55124 + type Values = T[keyof T]; + type ExtractFields = Values<{ + [K in keyof Options]: Options[K] extends object ? keyof Options[K] : never; + }>; + type SetType = { + [key: string]: any; + target?: ExtractFields; + }; + + declare function test55124>( + options: OptionsData, + ): void; + + test55124({ + target: "$test4", // ok + data1: { + $test1: 111, + $test2: null, + }, + data2: { + $test3: {}, + $test4: () => {}, + $test5() {}, + }, + }); + + test55124({ + target: "$test6", // error + ~~~~~~ +!!! error TS2820: Type '"$test6"' is not assignable to type 'ExtractFields<{ target: "$test6"; data1: { $test1: number; $test2: null; }; data2: { $test3: {}; $test4: () => void; $test5(): void; }; }> | undefined'. Did you mean '"$test4"'? +!!! related TS6500 thislessFunctionsNotContextSensitive1.ts:155:3: The expected type comes from property 'target' which is declared here on type 'SetType<{ target: "$test6"; data1: { $test1: number; $test2: null; }; data2: { $test3: {}; $test4: () => void; $test5(): void; }; }>' + data1: { + $test1: 111, + $test2: null, + }, + data2: { + $test3: {}, + $test4: () => {}, + $test5() {}, + }, + }); + + // https://github.com/microsoft/TypeScript/issues/53924 + function test53924(options: { a: (c: T) => void; b: () => T }) {} + + test53924({ + a: (c) => { + c; // number; + }, + b: () => 123, + }); + + test53924({ + b: () => 123, + a: (c) => { + return c; // number + }, + }); + + test53924({ + b() { + return 123; + }, + a(c) { + return c; // number + }, + }); + + test53924({ + a(c) { + return c; // number + }, + b() { + return 123; + }, + }); + + // https://github.com/microsoft/TypeScript/issues/50258 + declare function monitor any>( + extractor: (...args: Parameters) => Record, + executor: T, + ): (...args: Parameters) => ReturnType; + + monitor( + (p) => ({ p }), // { p: number } + (p: number) => p, + ); + monitor( + (p) => ({ p }), // { p: number } + function (p: number) { + return p; + }, + ); + \ No newline at end of file diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive1.symbols b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.symbols new file mode 100644 index 0000000000000..133cc720cbab1 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.symbols @@ -0,0 +1,621 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive1.ts] //// + +=== thislessFunctionsNotContextSensitive1.ts === +// https://github.com/microsoft/TypeScript/issues/62204 + +declare function TestConfig( +>TestConfig : Symbol(TestConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 0, 0)) +>TConfig : Symbol(TConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 28)) +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 51)) +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 60)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 69)) + + config: TConfig, +>config : Symbol(config, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 81)) +>TConfig : Symbol(TConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 28)) + + test: keyof Omit extends never ? true : false, +>test : Symbol(test, Decl(thislessFunctionsNotContextSensitive1.ts, 3, 18)) +>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --)) +>TConfig : Symbol(TConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 2, 28)) + +): void; + +TestConfig( +>TestConfig : Symbol(TestConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 0, 0)) + { + a: "hello", +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 8, 3)) + + b: function () { +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 9, 15)) + + return 123; + }, + }, + true, +); + +TestConfig( +>TestConfig : Symbol(TestConfig, Decl(thislessFunctionsNotContextSensitive1.ts, 0, 0)) + { + a: "hello", +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 18, 3)) + + b: function () { +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 19, 15)) + + return 123; + }, + }, + false, // error +); + +// https://github.com/microsoft/TypeScript/issues/60986 +interface SubscribeFieldOptions { +>SubscribeFieldOptions : Symbol(SubscribeFieldOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 25, 2)) +>Event : Symbol(Event, Decl(thislessFunctionsNotContextSensitive1.ts, 28, 32)) + + subscribe: () => Event; +>subscribe : Symbol(SubscribeFieldOptions.subscribe, Decl(thislessFunctionsNotContextSensitive1.ts, 28, 40)) +>Event : Symbol(Event, Decl(thislessFunctionsNotContextSensitive1.ts, 28, 32)) + + resolve: (event: Event) => number; +>resolve : Symbol(SubscribeFieldOptions.resolve, Decl(thislessFunctionsNotContextSensitive1.ts, 29, 25)) +>event : Symbol(event, Decl(thislessFunctionsNotContextSensitive1.ts, 30, 12)) +>Event : Symbol(Event, Decl(thislessFunctionsNotContextSensitive1.ts, 28, 32)) +} + +declare function defineOptions( +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 31, 1)) +>Event : Symbol(Event, Decl(thislessFunctionsNotContextSensitive1.ts, 33, 31)) + + options: SubscribeFieldOptions, +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive1.ts, 33, 38)) +>SubscribeFieldOptions : Symbol(SubscribeFieldOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 25, 2)) +>Event : Symbol(Event, Decl(thislessFunctionsNotContextSensitive1.ts, 33, 31)) + +): void; + +defineOptions({ +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 31, 1)) + + resolve: (event) => event, // number +>resolve : Symbol(resolve, Decl(thislessFunctionsNotContextSensitive1.ts, 37, 15)) +>event : Symbol(event, Decl(thislessFunctionsNotContextSensitive1.ts, 38, 12)) +>event : Symbol(event, Decl(thislessFunctionsNotContextSensitive1.ts, 38, 12)) + + subscribe() { +>subscribe : Symbol(subscribe, Decl(thislessFunctionsNotContextSensitive1.ts, 38, 28)) + + return 123; + }, +}); + +defineOptions({ +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 31, 1)) + + resolve: (event) => event, // number +>resolve : Symbol(resolve, Decl(thislessFunctionsNotContextSensitive1.ts, 44, 15)) +>event : Symbol(event, Decl(thislessFunctionsNotContextSensitive1.ts, 45, 12)) +>event : Symbol(event, Decl(thislessFunctionsNotContextSensitive1.ts, 45, 12)) + + subscribe: function () { +>subscribe : Symbol(subscribe, Decl(thislessFunctionsNotContextSensitive1.ts, 45, 28)) + + return 123; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/58630 + +export type StateFunction = (s: State, ...args: any[]) => any; +>StateFunction : Symbol(StateFunction, Decl(thislessFunctionsNotContextSensitive1.ts, 49, 3)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 26)) +>s : Symbol(s, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 36)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 26)) +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 45)) + +export type VuexStoreOptions = { +>VuexStoreOptions : Symbol(VuexStoreOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 69)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 29)) +>Modules : Symbol(Modules, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 35)) + + state?: State | (() => State) | { (): State }; +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 48)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 29)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 29)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 29)) + + mutations?: Record>; +>mutations : Symbol(mutations, Decl(thislessFunctionsNotContextSensitive1.ts, 56, 48)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>StateFunction : Symbol(StateFunction, Decl(thislessFunctionsNotContextSensitive1.ts, 49, 3)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 29)) + + modules?: { +>modules : Symbol(modules, Decl(thislessFunctionsNotContextSensitive1.ts, 57, 51)) + + [k in keyof Modules]: VuexStoreOptions; +>k : Symbol(k, Decl(thislessFunctionsNotContextSensitive1.ts, 59, 5)) +>Modules : Symbol(Modules, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 35)) +>VuexStoreOptions : Symbol(VuexStoreOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 69)) +>Modules : Symbol(Modules, Decl(thislessFunctionsNotContextSensitive1.ts, 55, 35)) +>k : Symbol(k, Decl(thislessFunctionsNotContextSensitive1.ts, 59, 5)) + + }; +}; + +export function createStore< +>createStore : Symbol(createStore, Decl(thislessFunctionsNotContextSensitive1.ts, 61, 2)) + + State extends Record, +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 63, 28)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + Modules extends Record>, +>Modules : Symbol(Modules, Decl(thislessFunctionsNotContextSensitive1.ts, 64, 40)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +>(options: VuexStoreOptions) {} +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive1.ts, 66, 2)) +>VuexStoreOptions : Symbol(VuexStoreOptions, Decl(thislessFunctionsNotContextSensitive1.ts, 53, 69)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 63, 28)) +>Modules : Symbol(Modules, Decl(thislessFunctionsNotContextSensitive1.ts, 64, 40)) + +const store = createStore({ +>store : Symbol(store, Decl(thislessFunctionsNotContextSensitive1.ts, 68, 5)) +>createStore : Symbol(createStore, Decl(thislessFunctionsNotContextSensitive1.ts, 61, 2)) + + state() { +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 68, 27)) + + return { bar2: 1 }; +>bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 70, 12)) + + }, + mutations: { inc: (state123) => state123.bar2++ }, +>mutations : Symbol(mutations, Decl(thislessFunctionsNotContextSensitive1.ts, 71, 4)) +>inc : Symbol(inc, Decl(thislessFunctionsNotContextSensitive1.ts, 72, 14)) +>state123 : Symbol(state123, Decl(thislessFunctionsNotContextSensitive1.ts, 72, 21)) +>state123.bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 70, 12)) +>state123 : Symbol(state123, Decl(thislessFunctionsNotContextSensitive1.ts, 72, 21)) +>bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 70, 12)) + + modules: { +>modules : Symbol(modules, Decl(thislessFunctionsNotContextSensitive1.ts, 72, 52)) + + foo: { +>foo : Symbol(foo, Decl(thislessFunctionsNotContextSensitive1.ts, 73, 12)) + + state() { +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 74, 10)) + + return { bar2: 1 }; +>bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 76, 16)) + + }, + mutations: { inc: (state) => state.bar2++ }, +>mutations : Symbol(mutations, Decl(thislessFunctionsNotContextSensitive1.ts, 77, 8)) +>inc : Symbol(inc, Decl(thislessFunctionsNotContextSensitive1.ts, 78, 18)) +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 78, 25)) +>state.bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 76, 16)) +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 78, 25)) +>bar2 : Symbol(bar2, Decl(thislessFunctionsNotContextSensitive1.ts, 76, 16)) + + }, + }, +}); + +// https://github.com/microsoft/TypeScript/issues/57572 + +type C = void>(options: { +>C : Symbol(C, Decl(thislessFunctionsNotContextSensitive1.ts, 81, 3)) +>Methods : Symbol(Methods, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 10)) +>Attached : Symbol(Attached, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 18)) +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 31)) +>Methods : Symbol(Methods, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 10)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 58)) + + methods: Methods; +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 68)) +>Methods : Symbol(Methods, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 10)) + + attached: Attached; +>attached : Symbol(attached, Decl(thislessFunctionsNotContextSensitive1.ts, 86, 19)) +>Attached : Symbol(Attached, Decl(thislessFunctionsNotContextSensitive1.ts, 85, 18)) + +}) => any; + +var Component: C = () => {}; +>Component : Symbol(Component, Decl(thislessFunctionsNotContextSensitive1.ts, 90, 3)) +>C : Symbol(C, Decl(thislessFunctionsNotContextSensitive1.ts, 81, 3)) + +Component({ +>Component : Symbol(Component, Decl(thislessFunctionsNotContextSensitive1.ts, 90, 3)) + + attached(methods) { +>attached : Symbol(attached, Decl(thislessFunctionsNotContextSensitive1.ts, 92, 11)) +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 93, 11)) + + methods.bbb(); // ok +>methods.bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 96, 12)) +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 93, 11)) +>bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 96, 12)) + + }, + methods: { +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 95, 4)) + + bbb() {}, +>bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 96, 12)) + + }, +}); + +Component({ +>Component : Symbol(Component, Decl(thislessFunctionsNotContextSensitive1.ts, 90, 3)) + + attached(methods) { +>attached : Symbol(attached, Decl(thislessFunctionsNotContextSensitive1.ts, 101, 11)) +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 102, 11)) + + methods.bbb(); // ok +>methods.bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 105, 12)) +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 102, 11)) +>bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 105, 12)) + + }, + methods: { +>methods : Symbol(methods, Decl(thislessFunctionsNotContextSensitive1.ts, 104, 4)) + + bbb: () => {}, +>bbb : Symbol(bbb, Decl(thislessFunctionsNotContextSensitive1.ts, 105, 12)) + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/56067 + +declare function create56067< +>create56067 : Symbol(create56067, Decl(thislessFunctionsNotContextSensitive1.ts, 108, 3)) + + State extends Record, +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 112, 29)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + Data extends Record, +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive1.ts, 113, 36)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + Actions extends (state: State, data: Data) => Record, +>Actions : Symbol(Actions, Decl(thislessFunctionsNotContextSensitive1.ts, 114, 35)) +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 115, 19)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 112, 29)) +>data : Symbol(data, Decl(thislessFunctionsNotContextSensitive1.ts, 115, 32)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive1.ts, 113, 36)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +>(args: { getState: () => State; actions: Actions; getData: () => Data }): void; +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive1.ts, 116, 2)) +>getState : Symbol(getState, Decl(thislessFunctionsNotContextSensitive1.ts, 116, 9)) +>State : Symbol(State, Decl(thislessFunctionsNotContextSensitive1.ts, 112, 29)) +>actions : Symbol(actions, Decl(thislessFunctionsNotContextSensitive1.ts, 116, 32)) +>Actions : Symbol(Actions, Decl(thislessFunctionsNotContextSensitive1.ts, 114, 35)) +>getData : Symbol(getData, Decl(thislessFunctionsNotContextSensitive1.ts, 116, 50)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive1.ts, 113, 36)) + +create56067({ +>create56067 : Symbol(create56067, Decl(thislessFunctionsNotContextSensitive1.ts, 108, 3)) + + getState() { +>getState : Symbol(getState, Decl(thislessFunctionsNotContextSensitive1.ts, 118, 13)) + + return { a: 1 }; +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 120, 12)) + + }, + getData: () => { +>getData : Symbol(getData, Decl(thislessFunctionsNotContextSensitive1.ts, 121, 4)) + + return { b: 2 }; +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 123, 12)) + + }, + actions(state, data) { +>actions : Symbol(actions, Decl(thislessFunctionsNotContextSensitive1.ts, 124, 4)) +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 125, 10)) +>data : Symbol(data, Decl(thislessFunctionsNotContextSensitive1.ts, 125, 16)) + + state // { a: number } +>state : Symbol(state, Decl(thislessFunctionsNotContextSensitive1.ts, 125, 10)) + + data; // { b: number } +>data : Symbol(data, Decl(thislessFunctionsNotContextSensitive1.ts, 125, 16)) + + return { + z: 1, +>z : Symbol(z, Decl(thislessFunctionsNotContextSensitive1.ts, 128, 12)) + + }; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/55489 +type NonStringIterable = +>NonStringIterable : Symbol(NonStringIterable, Decl(thislessFunctionsNotContextSensitive1.ts, 132, 3)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 135, 23)) + + T extends string ? never : T extends Iterable ? T : never; +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 135, 23)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 135, 23)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 135, 23)) + +declare function doSomething(value: NonStringIterable): T; +>doSomething : Symbol(doSomething, Decl(thislessFunctionsNotContextSensitive1.ts, 136, 65)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 138, 29)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive1.ts, 138, 32)) +>NonStringIterable : Symbol(NonStringIterable, Decl(thislessFunctionsNotContextSensitive1.ts, 132, 3)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 138, 29)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 138, 29)) + +const o = { foo() {} }; +>o : Symbol(o, Decl(thislessFunctionsNotContextSensitive1.ts, 140, 5)) +>foo : Symbol(foo, Decl(thislessFunctionsNotContextSensitive1.ts, 140, 11)) + +doSomething('value'); // error +>doSomething : Symbol(doSomething, Decl(thislessFunctionsNotContextSensitive1.ts, 136, 65)) + +doSomething(['v']); // ok +>doSomething : Symbol(doSomething, Decl(thislessFunctionsNotContextSensitive1.ts, 136, 65)) + +doSomething([o]); // ok +>doSomething : Symbol(doSomething, Decl(thislessFunctionsNotContextSensitive1.ts, 136, 65)) +>o : Symbol(o, Decl(thislessFunctionsNotContextSensitive1.ts, 140, 5)) + +doSomething([{ foo() {} }]); // ok +>doSomething : Symbol(doSomething, Decl(thislessFunctionsNotContextSensitive1.ts, 136, 65)) +>foo : Symbol(foo, Decl(thislessFunctionsNotContextSensitive1.ts, 145, 14)) + +// https://github.com/microsoft/TypeScript/issues/55124 +type Values = T[keyof T]; +>Values : Symbol(Values, Decl(thislessFunctionsNotContextSensitive1.ts, 145, 28)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 148, 12)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 148, 12)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 148, 12)) + +type ExtractFields = Values<{ +>ExtractFields : Symbol(ExtractFields, Decl(thislessFunctionsNotContextSensitive1.ts, 148, 28)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 149, 19)) +>Values : Symbol(Values, Decl(thislessFunctionsNotContextSensitive1.ts, 145, 28)) + + [K in keyof Options]: Options[K] extends object ? keyof Options[K] : never; +>K : Symbol(K, Decl(thislessFunctionsNotContextSensitive1.ts, 150, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 149, 19)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 149, 19)) +>K : Symbol(K, Decl(thislessFunctionsNotContextSensitive1.ts, 150, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 149, 19)) +>K : Symbol(K, Decl(thislessFunctionsNotContextSensitive1.ts, 150, 3)) + +}>; +type SetType = { +>SetType : Symbol(SetType, Decl(thislessFunctionsNotContextSensitive1.ts, 151, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 152, 13)) + + [key: string]: any; +>key : Symbol(key, Decl(thislessFunctionsNotContextSensitive1.ts, 153, 3)) + + target?: ExtractFields; +>target : Symbol(target, Decl(thislessFunctionsNotContextSensitive1.ts, 153, 21)) +>ExtractFields : Symbol(ExtractFields, Decl(thislessFunctionsNotContextSensitive1.ts, 148, 28)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive1.ts, 152, 13)) + +}; + +declare function test55124>( +>test55124 : Symbol(test55124, Decl(thislessFunctionsNotContextSensitive1.ts, 155, 2)) +>OptionsData : Symbol(OptionsData, Decl(thislessFunctionsNotContextSensitive1.ts, 157, 27)) +>SetType : Symbol(SetType, Decl(thislessFunctionsNotContextSensitive1.ts, 151, 3)) +>OptionsData : Symbol(OptionsData, Decl(thislessFunctionsNotContextSensitive1.ts, 157, 27)) + + options: OptionsData, +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive1.ts, 157, 69)) +>OptionsData : Symbol(OptionsData, Decl(thislessFunctionsNotContextSensitive1.ts, 157, 27)) + +): void; + +test55124({ +>test55124 : Symbol(test55124, Decl(thislessFunctionsNotContextSensitive1.ts, 155, 2)) + + target: "$test4", // ok +>target : Symbol(target, Decl(thislessFunctionsNotContextSensitive1.ts, 161, 11)) + + data1: { +>data1 : Symbol(data1, Decl(thislessFunctionsNotContextSensitive1.ts, 162, 19)) + + $test1: 111, +>$test1 : Symbol($test1, Decl(thislessFunctionsNotContextSensitive1.ts, 163, 10)) + + $test2: null, +>$test2 : Symbol($test2, Decl(thislessFunctionsNotContextSensitive1.ts, 164, 16)) + + }, + data2: { +>data2 : Symbol(data2, Decl(thislessFunctionsNotContextSensitive1.ts, 166, 4)) + + $test3: {}, +>$test3 : Symbol($test3, Decl(thislessFunctionsNotContextSensitive1.ts, 167, 10)) + + $test4: () => {}, +>$test4 : Symbol($test4, Decl(thislessFunctionsNotContextSensitive1.ts, 168, 15)) + + $test5() {}, +>$test5 : Symbol($test5, Decl(thislessFunctionsNotContextSensitive1.ts, 169, 21)) + + }, +}); + +test55124({ +>test55124 : Symbol(test55124, Decl(thislessFunctionsNotContextSensitive1.ts, 155, 2)) + + target: "$test6", // error +>target : Symbol(target, Decl(thislessFunctionsNotContextSensitive1.ts, 174, 11)) + + data1: { +>data1 : Symbol(data1, Decl(thislessFunctionsNotContextSensitive1.ts, 175, 19)) + + $test1: 111, +>$test1 : Symbol($test1, Decl(thislessFunctionsNotContextSensitive1.ts, 176, 10)) + + $test2: null, +>$test2 : Symbol($test2, Decl(thislessFunctionsNotContextSensitive1.ts, 177, 16)) + + }, + data2: { +>data2 : Symbol(data2, Decl(thislessFunctionsNotContextSensitive1.ts, 179, 4)) + + $test3: {}, +>$test3 : Symbol($test3, Decl(thislessFunctionsNotContextSensitive1.ts, 180, 10)) + + $test4: () => {}, +>$test4 : Symbol($test4, Decl(thislessFunctionsNotContextSensitive1.ts, 181, 15)) + + $test5() {}, +>$test5 : Symbol($test5, Decl(thislessFunctionsNotContextSensitive1.ts, 182, 21)) + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/53924 +function test53924(options: { a: (c: T) => void; b: () => T }) {} +>test53924 : Symbol(test53924, Decl(thislessFunctionsNotContextSensitive1.ts, 185, 3)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 19)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 32)) +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 42)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 47)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 19)) +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 61)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 188, 19)) + +test53924({ +>test53924 : Symbol(test53924, Decl(thislessFunctionsNotContextSensitive1.ts, 185, 3)) + + a: (c) => { +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 190, 11)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 191, 6)) + + c; // number; +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 191, 6)) + + }, + b: () => 123, +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 193, 4)) + +}); + +test53924({ +>test53924 : Symbol(test53924, Decl(thislessFunctionsNotContextSensitive1.ts, 185, 3)) + + b: () => 123, +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 197, 11)) + + a: (c) => { +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 198, 15)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 199, 6)) + + return c; // number +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 199, 6)) + + }, +}); + +test53924({ +>test53924 : Symbol(test53924, Decl(thislessFunctionsNotContextSensitive1.ts, 185, 3)) + + b() { +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 204, 11)) + + return 123; + }, + a(c) { +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 207, 4)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 208, 4)) + + return c; // number +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 208, 4)) + + }, +}); + +test53924({ +>test53924 : Symbol(test53924, Decl(thislessFunctionsNotContextSensitive1.ts, 185, 3)) + + a(c) { +>a : Symbol(a, Decl(thislessFunctionsNotContextSensitive1.ts, 213, 11)) +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 214, 4)) + + return c; // number +>c : Symbol(c, Decl(thislessFunctionsNotContextSensitive1.ts, 214, 4)) + + }, + b() { +>b : Symbol(b, Decl(thislessFunctionsNotContextSensitive1.ts, 216, 4)) + + return 123; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/50258 +declare function monitor any>( +>monitor : Symbol(monitor, Decl(thislessFunctionsNotContextSensitive1.ts, 220, 3)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 25)) +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 36)) + + extractor: (...args: Parameters) => Record, +>extractor : Symbol(extractor, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 58)) +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive1.ts, 224, 14)) +>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 25)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + + executor: T, +>executor : Symbol(executor, Decl(thislessFunctionsNotContextSensitive1.ts, 224, 65)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 25)) + +): (...args: Parameters) => ReturnType; +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive1.ts, 226, 4)) +>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 25)) +>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive1.ts, 223, 25)) + +monitor( +>monitor : Symbol(monitor, Decl(thislessFunctionsNotContextSensitive1.ts, 220, 3)) + + (p) => ({ p }), // { p: number } +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 229, 3)) +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 229, 11)) + + (p: number) => p, +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 230, 3)) +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 230, 3)) + +); +monitor( +>monitor : Symbol(monitor, Decl(thislessFunctionsNotContextSensitive1.ts, 220, 3)) + + (p) => ({ p }), // { p: number } +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 233, 3)) +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 233, 11)) + + function (p: number) { +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 234, 12)) + + return p; +>p : Symbol(p, Decl(thislessFunctionsNotContextSensitive1.ts, 234, 12)) + + }, +); + diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive1.types b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.types new file mode 100644 index 0000000000000..54eac35ad5070 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive1.types @@ -0,0 +1,926 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive1.ts] //// + +=== thislessFunctionsNotContextSensitive1.ts === +// https://github.com/microsoft/TypeScript/issues/62204 + +declare function TestConfig( +>TestConfig : (config: TConfig, test: keyof Omit extends never ? true : false) => void +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ +>a : any +> : ^^^ +>b : any +> : ^^^ +>c : any +> : ^^^ + + config: TConfig, +>config : TConfig +> : ^^^^^^^ + + test: keyof Omit extends never ? true : false, +>test : Exclude extends never ? true : false +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>true : true +> : ^^^^ +>false : false +> : ^^^^^ + +): void; + +TestConfig( +>TestConfig( { a: "hello", b: function () { return 123; }, }, true,) : void +> : ^^^^ +>TestConfig : (config: TConfig, test: keyof Omit extends never ? true : false) => void +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ + { +>{ a: "hello", b: function () { return 123; }, } : { a: "hello"; b: () => 123; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + a: "hello", +>a : "hello" +> : ^^^^^^^ +>"hello" : "hello" +> : ^^^^^^^ + + b: function () { +>b : () => 123 +> : ^^^^^^^^^ +>function () { return 123; } : () => 123 +> : ^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, + }, + true, +>true : true +> : ^^^^ + +); + +TestConfig( +>TestConfig( { a: "hello", b: function () { return 123; }, }, false, // error) : void +> : ^^^^ +>TestConfig : (config: TConfig, test: keyof Omit extends never ? true : false) => void +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ + { +>{ a: "hello", b: function () { return 123; }, } : { a: "hello"; b: () => 123; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + a: "hello", +>a : "hello" +> : ^^^^^^^ +>"hello" : "hello" +> : ^^^^^^^ + + b: function () { +>b : () => 123 +> : ^^^^^^^^^ +>function () { return 123; } : () => 123 +> : ^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, + }, + false, // error +>false : false +> : ^^^^^ + +); + +// https://github.com/microsoft/TypeScript/issues/60986 +interface SubscribeFieldOptions { + subscribe: () => Event; +>subscribe : () => Event +> : ^^^^^^ + + resolve: (event: Event) => number; +>resolve : (event: Event) => number +> : ^ ^^ ^^^^^ +>event : Event +> : ^^^^^ +} + +declare function defineOptions( +>defineOptions : (options: SubscribeFieldOptions) => void +> : ^ ^^ ^^ ^^^^^ + + options: SubscribeFieldOptions, +>options : SubscribeFieldOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +): void; + +defineOptions({ +>defineOptions({ resolve: (event) => event, // number subscribe() { return 123; },}) : void +> : ^^^^ +>defineOptions : (options: SubscribeFieldOptions) => void +> : ^ ^^ ^^ ^^^^^ +>{ resolve: (event) => event, // number subscribe() { return 123; },} : { resolve: (event: number) => number; subscribe(): number; } +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + resolve: (event) => event, // number +>resolve : (event: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>(event) => event : (event: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>event : number +> : ^^^^^^ +>event : number +> : ^^^^^^ + + subscribe() { +>subscribe : () => number +> : ^^^^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, +}); + +defineOptions({ +>defineOptions({ resolve: (event) => event, // number subscribe: function () { return 123; },}) : void +> : ^^^^ +>defineOptions : (options: SubscribeFieldOptions) => void +> : ^ ^^ ^^ ^^^^^ +>{ resolve: (event) => event, // number subscribe: function () { return 123; },} : { resolve: (event: number) => number; subscribe: () => number; } +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + resolve: (event) => event, // number +>resolve : (event: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>(event) => event : (event: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>event : number +> : ^^^^^^ +>event : number +> : ^^^^^^ + + subscribe: function () { +>subscribe : () => number +> : ^^^^^^^^^^^^ +>function () { return 123; } : () => number +> : ^^^^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/58630 + +export type StateFunction = (s: State, ...args: any[]) => any; +>StateFunction : StateFunction +> : ^^^^^^^^^^^^^^^^^^^^ +>s : State +> : ^^^^^ +>args : any[] +> : ^^^^^ + +export type VuexStoreOptions = { +>VuexStoreOptions : VuexStoreOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + state?: State | (() => State) | { (): State }; +>state : State | (() => State) | (() => State) | undefined +> : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ + + mutations?: Record>; +>mutations : Record> | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + modules?: { +>modules : { [k in keyof Modules]: VuexStoreOptions; } | undefined +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + [k in keyof Modules]: VuexStoreOptions; + }; +}; + +export function createStore< +>createStore : , Modules extends Record>>(options: VuexStoreOptions) => void +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ + + State extends Record, + Modules extends Record>, +>(options: VuexStoreOptions) {} +>options : VuexStoreOptions +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +const store = createStore({ +>store : void +> : ^^^^ +>createStore({ state() { return { bar2: 1 }; }, mutations: { inc: (state123) => state123.bar2++ }, modules: { foo: { state() { return { bar2: 1 }; }, mutations: { inc: (state) => state.bar2++ }, }, },}) : void +> : ^^^^ +>createStore : , Modules extends Record>>(options: VuexStoreOptions) => void +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^ +>{ state() { return { bar2: 1 }; }, mutations: { inc: (state123) => state123.bar2++ }, modules: { foo: { state() { return { bar2: 1 }; }, mutations: { inc: (state) => state.bar2++ }, }, },} : { state(): { bar2: number; }; mutations: { inc: (state123: { bar2: number; }) => number; }; modules: { foo: { state(): { bar2: number; }; mutations: { inc: (state: { bar2: number; }) => number; }; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + state() { +>state : () => { bar2: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + return { bar2: 1 }; +>{ bar2: 1 } : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>bar2 : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }, + mutations: { inc: (state123) => state123.bar2++ }, +>mutations : { inc: (state123: { bar2: number; }) => number; } +> : ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ inc: (state123) => state123.bar2++ } : { inc: (state123: { bar2: number; }) => number; } +> : ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inc : (state123: { bar2: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(state123) => state123.bar2++ : (state123: { bar2: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>state123 : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>state123.bar2++ : number +> : ^^^^^^ +>state123.bar2 : number +> : ^^^^^^ +>state123 : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>bar2 : number +> : ^^^^^^ + + modules: { +>modules : { foo: { state(): { bar2: number; }; mutations: { inc: (state: { bar2: number; }) => number; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ foo: { state() { return { bar2: 1 }; }, mutations: { inc: (state) => state.bar2++ }, }, } : { foo: { state(): { bar2: number; }; mutations: { inc: (state: { bar2: number; }) => number; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + foo: { +>foo : { state(): { bar2: number; }; mutations: { inc: (state: { bar2: number; }) => number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ state() { return { bar2: 1 }; }, mutations: { inc: (state) => state.bar2++ }, } : { state(): { bar2: number; }; mutations: { inc: (state: { bar2: number; }) => number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + state() { +>state : () => { bar2: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + return { bar2: 1 }; +>{ bar2: 1 } : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>bar2 : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }, + mutations: { inc: (state) => state.bar2++ }, +>mutations : { inc: (state: { bar2: number; }) => number; } +> : ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ inc: (state) => state.bar2++ } : { inc: (state: { bar2: number; }) => number; } +> : ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>inc : (state: { bar2: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(state) => state.bar2++ : (state: { bar2: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>state : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>state.bar2++ : number +> : ^^^^^^ +>state.bar2 : number +> : ^^^^^^ +>state : { bar2: number; } +> : ^^^^^^^^^^^^^^^^^ +>bar2 : number +> : ^^^^^^ + + }, + }, +}); + +// https://github.com/microsoft/TypeScript/issues/57572 + +type C = void>(options: { +>C : C +> : ^ +>methods : Methods +> : ^^^^^^^ +>options : { methods: Methods; attached: Attached; } +> : ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^ + + methods: Methods; +>methods : Methods +> : ^^^^^^^ + + attached: Attached; +>attached : Attached +> : ^^^^^^^^ + +}) => any; + +var Component: C = () => {}; +>Component : C +> : ^ +>() => {} : () => void +> : ^^^^^^^^^^ + +Component({ +>Component({ attached(methods) { methods.bbb(); // ok }, methods: { bbb() {}, },}) : any +> : ^^^ +>Component : C +> : ^ +>{ attached(methods) { methods.bbb(); // ok }, methods: { bbb() {}, },} : { attached(methods: { bbb(): void; }): void; methods: { bbb(): void; }; } +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + attached(methods) { +>attached : (methods: { bbb(): void; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>methods : { bbb(): void; } +> : ^^^^^^^^^^^^^^^^ + + methods.bbb(); // ok +>methods.bbb() : void +> : ^^^^ +>methods.bbb : () => void +> : ^^^^^^^^^^ +>methods : { bbb(): void; } +> : ^^^^^^^^^^^^^^^^ +>bbb : () => void +> : ^^^^^^^^^^ + + }, + methods: { +>methods : { bbb(): void; } +> : ^^^^^^^^^^^^^^^^ +>{ bbb() {}, } : { bbb(): void; } +> : ^^^^^^^^^^^^^^^^ + + bbb() {}, +>bbb : () => void +> : ^^^^^^^^^^ + + }, +}); + +Component({ +>Component({ attached(methods) { methods.bbb(); // ok }, methods: { bbb: () => {}, },}) : any +> : ^^^ +>Component : C +> : ^ +>{ attached(methods) { methods.bbb(); // ok }, methods: { bbb: () => {}, },} : { attached(methods: { bbb: () => void; }): void; methods: { bbb: () => void; }; } +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + attached(methods) { +>attached : (methods: { bbb: () => void; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>methods : { bbb: () => void; } +> : ^^^^^^^^^^^^^^^^^^^^ + + methods.bbb(); // ok +>methods.bbb() : void +> : ^^^^ +>methods.bbb : () => void +> : ^^^^^^^^^^ +>methods : { bbb: () => void; } +> : ^^^^^^^^^^^^^^^^^^^^ +>bbb : () => void +> : ^^^^^^^^^^ + + }, + methods: { +>methods : { bbb: () => void; } +> : ^^^^^^^^^^^^^^^^^^^^ +>{ bbb: () => {}, } : { bbb: () => void; } +> : ^^^^^^^^^^^^^^^^^^^^ + + bbb: () => {}, +>bbb : () => void +> : ^^^^^^^^^^ +>() => {} : () => void +> : ^^^^^^^^^^ + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/56067 + +declare function create56067< +>create56067 : , Data extends Record, Actions extends (state: State, data: Data) => Record>(args: { getState: () => State; actions: Actions; getData: () => Data; }) => void +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + State extends Record, + Data extends Record, + Actions extends (state: State, data: Data) => Record, +>state : State +> : ^^^^^ +>data : Data +> : ^^^^ + +>(args: { getState: () => State; actions: Actions; getData: () => Data }): void; +>args : { getState: () => State; actions: Actions; getData: () => Data; } +> : ^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^ +>getState : () => State +> : ^^^^^^ +>actions : Actions +> : ^^^^^^^ +>getData : () => Data +> : ^^^^^^ + +create56067({ +>create56067({ getState() { return { a: 1 }; }, getData: () => { return { b: 2 }; }, actions(state, data) { state // { a: number } data; // { b: number } return { z: 1, }; },}) : void +> : ^^^^ +>create56067 : , Data extends Record, Actions extends (state: State, data: Data) => Record>(args: { getState: () => State; actions: Actions; getData: () => Data; }) => void +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ getState() { return { a: 1 }; }, getData: () => { return { b: 2 }; }, actions(state, data) { state // { a: number } data; // { b: number } return { z: 1, }; },} : { getState(): { a: number; }; getData: () => { b: number; }; actions(state: { a: number; }, data: { b: number; }): { z: number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + getState() { +>getState : () => { a: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + + return { a: 1 }; +>{ a: 1 } : { a: number; } +> : ^^^^^^^^^^^^^^ +>a : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }, + getData: () => { +>getData : () => { b: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>() => { return { b: 2 }; } : () => { b: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + + return { b: 2 }; +>{ b: 2 } : { b: number; } +> : ^^^^^^^^^^^^^^ +>b : number +> : ^^^^^^ +>2 : 2 +> : ^ + + }, + actions(state, data) { +>actions : (state: { a: number; }, data: { b: number; }) => { z: number; } +> : ^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>state : { a: number; } +> : ^^^^^^^^^^^^^^ +>data : { b: number; } +> : ^^^^^^^^^^^^^^ + + state // { a: number } +>state : { a: number; } +> : ^^^^^^^^^^^^^^ + + data; // { b: number } +>data : { b: number; } +> : ^^^^^^^^^^^^^^ + + return { +>{ z: 1, } : { z: number; } +> : ^^^^^^^^^^^^^^ + + z: 1, +>z : number +> : ^^^^^^ +>1 : 1 +> : ^ + + }; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/55489 +type NonStringIterable = +>NonStringIterable : NonStringIterable +> : ^^^^^^^^^^^^^^^^^^^^ + + T extends string ? never : T extends Iterable ? T : never; + +declare function doSomething(value: NonStringIterable): T; +>doSomething : (value: NonStringIterable) => T +> : ^ ^^ ^^ ^^^^^ +>value : NonStringIterable +> : ^^^^^^^^^^^^^^^^^^^^ + +const o = { foo() {} }; +>o : { foo(): void; } +> : ^^^^^^^^^^^^^^^^ +>{ foo() {} } : { foo(): void; } +> : ^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ + +doSomething('value'); // error +>doSomething('value') : "value" +> : ^^^^^^^ +>doSomething : (value: NonStringIterable) => T +> : ^ ^^ ^^ ^^^^^ +>'value' : "value" +> : ^^^^^^^ + +doSomething(['v']); // ok +>doSomething(['v']) : string[] +> : ^^^^^^^^ +>doSomething : (value: NonStringIterable) => T +> : ^ ^^ ^^ ^^^^^ +>['v'] : string[] +> : ^^^^^^^^ +>'v' : "v" +> : ^^^ + +doSomething([o]); // ok +>doSomething([o]) : { foo(): void; }[] +> : ^^^^^^^^^^^^^^^^^^ +>doSomething : (value: NonStringIterable) => T +> : ^ ^^ ^^ ^^^^^ +>[o] : { foo(): void; }[] +> : ^^^^^^^^^^^^^^^^^^ +>o : { foo(): void; } +> : ^^^^^^^^^^^^^^^^ + +doSomething([{ foo() {} }]); // ok +>doSomething([{ foo() {} }]) : { foo(): void; }[] +> : ^^^^^^^^^^^^^^^^^^ +>doSomething : (value: NonStringIterable) => T +> : ^ ^^ ^^ ^^^^^ +>[{ foo() {} }] : { foo(): void; }[] +> : ^^^^^^^^^^^^^^^^^^ +>{ foo() {} } : { foo(): void; } +> : ^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ + +// https://github.com/microsoft/TypeScript/issues/55124 +type Values = T[keyof T]; +>Values : Values +> : ^^^^^^^^^ + +type ExtractFields = Values<{ +>ExtractFields : ExtractFields +> : ^^^^^^^^^^^^^^^^^^^^^^ + + [K in keyof Options]: Options[K] extends object ? keyof Options[K] : never; +}>; +type SetType = { +>SetType : SetType +> : ^^^^^^^^^^^^^^^^ + + [key: string]: any; +>key : string +> : ^^^^^^ + + target?: ExtractFields; +>target : ExtractFields | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}; + +declare function test55124>( +>test55124 : >(options: OptionsData) => void +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + options: OptionsData, +>options : OptionsData +> : ^^^^^^^^^^^ + +): void; + +test55124({ +>test55124({ target: "$test4", // ok data1: { $test1: 111, $test2: null, }, data2: { $test3: {}, $test4: () => {}, $test5() {}, },}) : void +> : ^^^^ +>test55124 : >(options: OptionsData) => void +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ target: "$test4", // ok data1: { $test1: 111, $test2: null, }, data2: { $test3: {}, $test4: () => {}, $test5() {}, },} : { target: "$test4"; data1: { $test1: number; $test2: null; }; data2: { $test3: {}; $test4: () => void; $test5(): void; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + target: "$test4", // ok +>target : "$test4" +> : ^^^^^^^^ +>"$test4" : "$test4" +> : ^^^^^^^^ + + data1: { +>data1 : { $test1: number; $test2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ $test1: 111, $test2: null, } : { $test1: number; $test2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + $test1: 111, +>$test1 : number +> : ^^^^^^ +>111 : 111 +> : ^^^ + + $test2: null, +>$test2 : null +> : ^^^^ + + }, + data2: { +>data2 : { $test3: {}; $test4: () => void; $test5(): void; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ $test3: {}, $test4: () => {}, $test5() {}, } : { $test3: {}; $test4: () => void; $test5(): void; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + $test3: {}, +>$test3 : {} +> : ^^ +>{} : {} +> : ^^ + + $test4: () => {}, +>$test4 : () => void +> : ^^^^^^^^^^ +>() => {} : () => void +> : ^^^^^^^^^^ + + $test5() {}, +>$test5 : () => void +> : ^^^^^^^^^^ + + }, +}); + +test55124({ +>test55124({ target: "$test6", // error data1: { $test1: 111, $test2: null, }, data2: { $test3: {}, $test4: () => {}, $test5() {}, },}) : void +> : ^^^^ +>test55124 : >(options: OptionsData) => void +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ target: "$test6", // error data1: { $test1: 111, $test2: null, }, data2: { $test3: {}, $test4: () => {}, $test5() {}, },} : { target: "$test6"; data1: { $test1: number; $test2: null; }; data2: { $test3: {}; $test4: () => void; $test5(): void; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + target: "$test6", // error +>target : "$test6" +> : ^^^^^^^^ +>"$test6" : "$test6" +> : ^^^^^^^^ + + data1: { +>data1 : { $test1: number; $test2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ $test1: 111, $test2: null, } : { $test1: number; $test2: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + $test1: 111, +>$test1 : number +> : ^^^^^^ +>111 : 111 +> : ^^^ + + $test2: null, +>$test2 : null +> : ^^^^ + + }, + data2: { +>data2 : { $test3: {}; $test4: () => void; $test5(): void; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ $test3: {}, $test4: () => {}, $test5() {}, } : { $test3: {}; $test4: () => void; $test5(): void; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + $test3: {}, +>$test3 : {} +> : ^^ +>{} : {} +> : ^^ + + $test4: () => {}, +>$test4 : () => void +> : ^^^^^^^^^^ +>() => {} : () => void +> : ^^^^^^^^^^ + + $test5() {}, +>$test5 : () => void +> : ^^^^^^^^^^ + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/53924 +function test53924(options: { a: (c: T) => void; b: () => T }) {} +>test53924 : (options: { a: (c: T) => void; b: () => T; }) => void +> : ^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^ +>options : { a: (c: T) => void; b: () => T; } +> : ^^^^^ ^^^^^ ^^^ +>a : (c: T) => void +> : ^ ^^ ^^^^^ +>c : T +> : ^ +>b : () => T +> : ^^^^^^ + +test53924({ +>test53924({ a: (c) => { c; // number; }, b: () => 123,}) : void +> : ^^^^ +>test53924 : (options: { a: (c: T) => void; b: () => T; }) => void +> : ^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^ +>{ a: (c) => { c; // number; }, b: () => 123,} : { a: (c: number) => void; b: () => number; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + a: (c) => { +>a : (c: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>(c) => { c; // number; } : (c: number) => void +> : ^ ^^^^^^^^^^^^^^^^^ +>c : number +> : ^^^^^^ + + c; // number; +>c : number +> : ^^^^^^ + + }, + b: () => 123, +>b : () => number +> : ^^^^^^^^^^^^ +>() => 123 : () => number +> : ^^^^^^^^^^^^ +>123 : 123 +> : ^^^ + +}); + +test53924({ +>test53924({ b: () => 123, a: (c) => { return c; // number },}) : void +> : ^^^^ +>test53924 : (options: { a: (c: T) => void; b: () => T; }) => void +> : ^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^ +>{ b: () => 123, a: (c) => { return c; // number },} : { b: () => number; a: (c: number) => number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ + + b: () => 123, +>b : () => number +> : ^^^^^^^^^^^^ +>() => 123 : () => number +> : ^^^^^^^^^^^^ +>123 : 123 +> : ^^^ + + a: (c) => { +>a : (c: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>(c) => { return c; // number } : (c: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>c : number +> : ^^^^^^ + + return c; // number +>c : number +> : ^^^^^^ + + }, +}); + +test53924({ +>test53924({ b() { return 123; }, a(c) { return c; // number },}) : void +> : ^^^^ +>test53924 : (options: { a: (c: T) => void; b: () => T; }) => void +> : ^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^ +>{ b() { return 123; }, a(c) { return c; // number },} : { b(): number; a(c: number): number; } +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ + + b() { +>b : () => number +> : ^^^^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, + a(c) { +>a : (c: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>c : number +> : ^^^^^^ + + return c; // number +>c : number +> : ^^^^^^ + + }, +}); + +test53924({ +>test53924({ a(c) { return c; // number }, b() { return 123; },}) : void +> : ^^^^ +>test53924 : (options: { a: (c: T) => void; b: () => T; }) => void +> : ^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^ +>{ a(c) { return c; // number }, b() { return 123; },} : { a(c: number): number; b(): number; } +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + a(c) { +>a : (c: number) => number +> : ^ ^^^^^^^^^^^^^^^^^^^ +>c : number +> : ^^^^^^ + + return c; // number +>c : number +> : ^^^^^^ + + }, + b() { +>b : () => number +> : ^^^^^^^^^^^^ + + return 123; +>123 : 123 +> : ^^^ + + }, +}); + +// https://github.com/microsoft/TypeScript/issues/50258 +declare function monitor any>( +>monitor : any>(extractor: (...args: Parameters) => Record, executor: T) => (...args: Parameters) => ReturnType +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ +>args : any +> : ^^^ + + extractor: (...args: Parameters) => Record, +>extractor : (...args: Parameters) => Record +> : ^^^^ ^^ ^^^^^ +>args : Parameters +> : ^^^^^^^^^^^^^ + + executor: T, +>executor : T +> : ^ + +): (...args: Parameters) => ReturnType; +>args : Parameters +> : ^^^^^^^^^^^^^ + +monitor( +>monitor( (p) => ({ p }), // { p: number } (p: number) => p,) : (p: number) => number +> : ^^^^^^^^^^^^^^^^^^^^^ +>monitor : any>(extractor: (...args: Parameters) => Record, executor: T) => (...args: Parameters) => ReturnType +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ + + (p) => ({ p }), // { p: number } +>(p) => ({ p }) : (p: number) => { p: number; } +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>p : number +> : ^^^^^^ +>({ p }) : { p: number; } +> : ^^^^^^^^^^^^^^ +>{ p } : { p: number; } +> : ^^^^^^^^^^^^^^ +>p : number +> : ^^^^^^ + + (p: number) => p, +>(p: number) => p : (p: number) => number +> : ^ ^^ ^^^^^^^^^^^ +>p : number +> : ^^^^^^ +>p : number +> : ^^^^^^ + +); +monitor( +>monitor( (p) => ({ p }), // { p: number } function (p: number) { return p; },) : (p: number) => number +> : ^^^^^^^^^^^^^^^^^^^^^ +>monitor : any>(extractor: (...args: Parameters) => Record, executor: T) => (...args: Parameters) => ReturnType +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ + + (p) => ({ p }), // { p: number } +>(p) => ({ p }) : (p: number) => { p: number; } +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>p : number +> : ^^^^^^ +>({ p }) : { p: number; } +> : ^^^^^^^^^^^^^^ +>{ p } : { p: number; } +> : ^^^^^^^^^^^^^^ +>p : number +> : ^^^^^^ + + function (p: number) { +>function (p: number) { return p; } : (p: number) => number +> : ^ ^^ ^^^^^^^^^^^ +>p : number +> : ^^^^^^ + + return p; +>p : number +> : ^^^^^^ + + }, +); + diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive2.errors.txt b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.errors.txt new file mode 100644 index 0000000000000..299f833b65a1b --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.errors.txt @@ -0,0 +1,132 @@ +thislessFunctionsNotContextSensitive2.ts(52,14): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +thislessFunctionsNotContextSensitive2.ts(83,12): error TS7041: The containing arrow function captures the global value of 'this'. + + +==== thislessFunctionsNotContextSensitive2.ts (2 errors) ==== + interface Options { + context: Context; + produce(this: Context): Data; + consume(this: Context, data: Data): void; + } + + declare function defineOptions( + options: Options, + ): [Context, Data]; + + const result1 = defineOptions({ + context: { tag: "A", value: 1 }, + consume(_data) {}, + produce() { + return 42; + }, + }); + + const result2 = defineOptions({ + context: { tag: "B", value: 2 }, + consume(_data) {}, + produce() { + return this.value; + }, + }); + + const result3 = defineOptions({ + context: { tag: "C", value: 3 }, + consume(_data) {}, + produce: () => 123, + }); + + const result4 = defineOptions({ + context: { tag: "D", value: 4 }, + consume(_data) {}, + produce() { + class Local { + value = 'foo'; + get() { + return this.value; + } + } + return new Local().get();; + }, + }); + + const result5 = defineOptions({ + context: { tag: "E", value: 5 }, + consume(_data) {}, + produce() { + function inner() { + return this; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 thislessFunctionsNotContextSensitive2.ts:51:14: An outer value of 'this' is shadowed by this container. + } + return inner(); + }, + }); + + const result6 = defineOptions({ + context: { tag: "F", value: 6 }, + consume(_data) {}, + produce() { + const arrow = () => this.value; + return arrow(); + }, + }); + + const result7 = defineOptions({ + context: { tag: "G", value: 7 }, + consume(_data) {}, + produce() { + const self = this; + function inner() { + return self.value; + } + return inner(); + }, + }); + + const result8 = defineOptions({ + context: { tag: "H", value: 8 }, + consume(_data) {}, + produce: () => { + return this; + ~~~~ +!!! error TS7041: The containing arrow function captures the global value of 'this'. + }, + }); + + const result9 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + const obj = { + value: 'foo', + get() { + return this.value; + }, + }; + return obj.get(); + }, + }); + + const result10 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + interface Foo { + prop: this; + } + return {} as Foo; + }, + }); + + const result11 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + function fn(this: { prop: string }) { + return this.prop; + } + return fn; + }, + }); + \ No newline at end of file diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive2.symbols b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.symbols new file mode 100644 index 0000000000000..29d0c190d417f --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.symbols @@ -0,0 +1,353 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive2.ts] //// + +=== thislessFunctionsNotContextSensitive2.ts === +interface Options { +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 0)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 18)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 26)) + + context: Context; +>context : Symbol(Options.context, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 34)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 18)) + + produce(this: Context): Data; +>produce : Symbol(Options.produce, Decl(thislessFunctionsNotContextSensitive2.ts, 1, 19)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 2, 10)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 18)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 26)) + + consume(this: Context, data: Data): void; +>consume : Symbol(Options.consume, Decl(thislessFunctionsNotContextSensitive2.ts, 2, 31)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 3, 10)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 18)) +>data : Symbol(data, Decl(thislessFunctionsNotContextSensitive2.ts, 3, 24)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 26)) +} + +declare function defineOptions( +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 31)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 39)) + + options: Options, +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 46)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive2.ts, 0, 0)) +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 31)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 39)) + +): [Context, Data]; +>Context : Symbol(Context, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 31)) +>Data : Symbol(Data, Decl(thislessFunctionsNotContextSensitive2.ts, 6, 39)) + +const result1 = defineOptions({ +>result1 : Symbol(result1, Decl(thislessFunctionsNotContextSensitive2.ts, 10, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "A", value: 1 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 10, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 11, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 11, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 11, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 12, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 12, 20)) + + return 42; + }, +}); + +const result2 = defineOptions({ +>result2 : Symbol(result2, Decl(thislessFunctionsNotContextSensitive2.ts, 18, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "B", value: 2 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 18, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 19, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 19, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 19, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 20, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 20, 20)) + + return this.value; +>this.value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 19, 22)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 2, 10)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 19, 22)) + + }, +}); + +const result3 = defineOptions({ +>result3 : Symbol(result3, Decl(thislessFunctionsNotContextSensitive2.ts, 26, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "C", value: 3 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 26, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 27, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 27, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 27, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 28, 10)) + + produce: () => 123, +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 28, 20)) + +}); + +const result4 = defineOptions({ +>result4 : Symbol(result4, Decl(thislessFunctionsNotContextSensitive2.ts, 32, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "D", value: 4 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 32, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 33, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 33, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 33, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 34, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 34, 20)) + + class Local { +>Local : Symbol(Local, Decl(thislessFunctionsNotContextSensitive2.ts, 35, 13)) + + value = 'foo'; +>value : Symbol(Local.value, Decl(thislessFunctionsNotContextSensitive2.ts, 36, 17)) + + get() { +>get : Symbol(Local.get, Decl(thislessFunctionsNotContextSensitive2.ts, 37, 20)) + + return this.value; +>this.value : Symbol(Local.value, Decl(thislessFunctionsNotContextSensitive2.ts, 36, 17)) +>this : Symbol(Local, Decl(thislessFunctionsNotContextSensitive2.ts, 35, 13)) +>value : Symbol(Local.value, Decl(thislessFunctionsNotContextSensitive2.ts, 36, 17)) + } + } + return new Local().get();; +>new Local().get : Symbol(Local.get, Decl(thislessFunctionsNotContextSensitive2.ts, 37, 20)) +>Local : Symbol(Local, Decl(thislessFunctionsNotContextSensitive2.ts, 35, 13)) +>get : Symbol(Local.get, Decl(thislessFunctionsNotContextSensitive2.ts, 37, 20)) + + }, +}); + +const result5 = defineOptions({ +>result5 : Symbol(result5, Decl(thislessFunctionsNotContextSensitive2.ts, 46, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "E", value: 5 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 46, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 47, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 47, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 47, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 48, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 48, 20)) + + function inner() { +>inner : Symbol(inner, Decl(thislessFunctionsNotContextSensitive2.ts, 49, 13)) + + return this; + } + return inner(); +>inner : Symbol(inner, Decl(thislessFunctionsNotContextSensitive2.ts, 49, 13)) + + }, +}); + +const result6 = defineOptions({ +>result6 : Symbol(result6, Decl(thislessFunctionsNotContextSensitive2.ts, 57, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "F", value: 6 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 57, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 58, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 58, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 58, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 59, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 59, 20)) + + const arrow = () => this.value; +>arrow : Symbol(arrow, Decl(thislessFunctionsNotContextSensitive2.ts, 61, 9)) +>this.value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 58, 22)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 2, 10)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 58, 22)) + + return arrow(); +>arrow : Symbol(arrow, Decl(thislessFunctionsNotContextSensitive2.ts, 61, 9)) + + }, +}); + +const result7 = defineOptions({ +>result7 : Symbol(result7, Decl(thislessFunctionsNotContextSensitive2.ts, 66, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "G", value: 7 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 66, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 67, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 67, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 67, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 68, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 68, 20)) + + const self = this; +>self : Symbol(self, Decl(thislessFunctionsNotContextSensitive2.ts, 70, 9)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 2, 10)) + + function inner() { +>inner : Symbol(inner, Decl(thislessFunctionsNotContextSensitive2.ts, 70, 22)) + + return self.value; +>self.value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 67, 22)) +>self : Symbol(self, Decl(thislessFunctionsNotContextSensitive2.ts, 70, 9)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 67, 22)) + } + return inner(); +>inner : Symbol(inner, Decl(thislessFunctionsNotContextSensitive2.ts, 70, 22)) + + }, +}); + +const result8 = defineOptions({ +>result8 : Symbol(result8, Decl(thislessFunctionsNotContextSensitive2.ts, 78, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "H", value: 8 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 78, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 79, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 79, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 79, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 80, 10)) + + produce: () => { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 80, 20)) + + return this; +>this : Symbol(globalThis) + + }, +}); + +const result9 = defineOptions({ +>result9 : Symbol(result9, Decl(thislessFunctionsNotContextSensitive2.ts, 86, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "I", value: 9 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 86, 31)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 87, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 87, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 87, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 88, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 88, 20)) + + const obj = { +>obj : Symbol(obj, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 9)) + + value: 'foo', +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 17)) + + get() { +>get : Symbol(get, Decl(thislessFunctionsNotContextSensitive2.ts, 91, 19)) + + return this.value; +>this.value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 17)) +>this : Symbol(obj, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 15)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 17)) + + }, + }; + return obj.get(); +>obj.get : Symbol(get, Decl(thislessFunctionsNotContextSensitive2.ts, 91, 19)) +>obj : Symbol(obj, Decl(thislessFunctionsNotContextSensitive2.ts, 90, 9)) +>get : Symbol(get, Decl(thislessFunctionsNotContextSensitive2.ts, 91, 19)) + + }, +}); + +const result10 = defineOptions({ +>result10 : Symbol(result10, Decl(thislessFunctionsNotContextSensitive2.ts, 100, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "I", value: 9 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 100, 32)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 101, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 101, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 101, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 102, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 102, 20)) + + interface Foo { +>Foo : Symbol(Foo, Decl(thislessFunctionsNotContextSensitive2.ts, 103, 13)) + + prop: this; +>prop : Symbol(Foo.prop, Decl(thislessFunctionsNotContextSensitive2.ts, 104, 19)) + } + return {} as Foo; +>Foo : Symbol(Foo, Decl(thislessFunctionsNotContextSensitive2.ts, 103, 13)) + + }, +}); + +const result11 = defineOptions({ +>result11 : Symbol(result11, Decl(thislessFunctionsNotContextSensitive2.ts, 111, 5)) +>defineOptions : Symbol(defineOptions, Decl(thislessFunctionsNotContextSensitive2.ts, 4, 1)) + + context: { tag: "I", value: 9 }, +>context : Symbol(context, Decl(thislessFunctionsNotContextSensitive2.ts, 111, 32)) +>tag : Symbol(tag, Decl(thislessFunctionsNotContextSensitive2.ts, 112, 12)) +>value : Symbol(value, Decl(thislessFunctionsNotContextSensitive2.ts, 112, 22)) + + consume(_data) {}, +>consume : Symbol(consume, Decl(thislessFunctionsNotContextSensitive2.ts, 112, 34)) +>_data : Symbol(_data, Decl(thislessFunctionsNotContextSensitive2.ts, 113, 10)) + + produce() { +>produce : Symbol(produce, Decl(thislessFunctionsNotContextSensitive2.ts, 113, 20)) + + function fn(this: { prop: string }) { +>fn : Symbol(fn, Decl(thislessFunctionsNotContextSensitive2.ts, 114, 13)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 115, 16)) +>prop : Symbol(prop, Decl(thislessFunctionsNotContextSensitive2.ts, 115, 23)) + + return this.prop; +>this.prop : Symbol(prop, Decl(thislessFunctionsNotContextSensitive2.ts, 115, 23)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive2.ts, 115, 16)) +>prop : Symbol(prop, Decl(thislessFunctionsNotContextSensitive2.ts, 115, 23)) + } + return fn; +>fn : Symbol(fn, Decl(thislessFunctionsNotContextSensitive2.ts, 114, 13)) + + }, +}); + diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive2.types b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.types new file mode 100644 index 0000000000000..9d035d78b6451 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive2.types @@ -0,0 +1,619 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive2.ts] //// + +=== thislessFunctionsNotContextSensitive2.ts === +interface Options { + context: Context; +>context : Context +> : ^^^^^^^ + + produce(this: Context): Data; +>produce : (this: Context) => Data +> : ^ ^^ ^^^^^ +>this : Context +> : ^^^^^^^ + + consume(this: Context, data: Data): void; +>consume : (this: Context, data: Data) => void +> : ^ ^^ ^^ ^^ ^^^^^ +>this : Context +> : ^^^^^^^ +>data : Data +> : ^^^^ +} + +declare function defineOptions( +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ + + options: Options, +>options : Options +> : ^^^^^^^^^^^^^^^^^^^^^^ + +): [Context, Data]; + +const result1 = defineOptions({ +>result1 : [{ tag: string; value: number; }, number] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "A", value: 1 }, consume(_data) {}, produce() { return 42; },}) : [{ tag: string; value: number; }, number] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "A", value: 1 }, consume(_data) {}, produce() { return 42; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: number): void; produce(): number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "A", value: 1 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "A", value: 1 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"A" : "A" +> : ^^^ +>value : number +> : ^^^^^^ +>1 : 1 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: number) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ +>_data : number +> : ^^^^^^ + + produce() { +>produce : () => number +> : ^^^^^^^^^^^^ + + return 42; +>42 : 42 +> : ^^ + + }, +}); + +const result2 = defineOptions({ +>result2 : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "B", value: 2 }, consume(_data) {}, produce() { return this.value; },}) : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "B", value: 2 }, consume(_data) {}, produce() { return this.value; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: unknown): void; produce(this: { tag: string; value: number; }): number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "B", value: 2 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "B", value: 2 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"B" : "B" +> : ^^^ +>value : number +> : ^^^^^^ +>2 : 2 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: unknown) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +>_data : unknown +> : ^^^^^^^ + + produce() { +>produce : (this: { tag: string; value: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return this.value; +>this.value : number +> : ^^^^^^ +>this : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : number +> : ^^^^^^ + + }, +}); + +const result3 = defineOptions({ +>result3 : [{ tag: string; value: number; }, number] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "C", value: 3 }, consume(_data) {}, produce: () => 123,}) : [{ tag: string; value: number; }, number] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "C", value: 3 }, consume(_data) {}, produce: () => 123,} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: number): void; produce: () => number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "C", value: 3 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "C", value: 3 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"C" : "C" +> : ^^^ +>value : number +> : ^^^^^^ +>3 : 3 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: number) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ +>_data : number +> : ^^^^^^ + + produce: () => 123, +>produce : () => number +> : ^^^^^^^^^^^^ +>() => 123 : () => number +> : ^^^^^^^^^^^^ +>123 : 123 +> : ^^^ + +}); + +const result4 = defineOptions({ +>result4 : [{ tag: string; value: number; }, string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "D", value: 4 }, consume(_data) {}, produce() { class Local { value = 'foo'; get() { return this.value; } } return new Local().get();; },}) : [{ tag: string; value: number; }, string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "D", value: 4 }, consume(_data) {}, produce() { class Local { value = 'foo'; get() { return this.value; } } return new Local().get();; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: string): void; produce(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "D", value: 4 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "D", value: 4 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"D" : "D" +> : ^^^ +>value : number +> : ^^^^^^ +>4 : 4 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: string) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ +>_data : string +> : ^^^^^^ + + produce() { +>produce : () => string +> : ^^^^^^^^^^^^ + + class Local { +>Local : Local +> : ^^^^^ + + value = 'foo'; +>value : string +> : ^^^^^^ +>'foo' : "foo" +> : ^^^^^ + + get() { +>get : () => string +> : ^^^^^^^^^^^^ + + return this.value; +>this.value : string +> : ^^^^^^ +>this : this +> : ^^^^ +>value : string +> : ^^^^^^ + } + } + return new Local().get();; +>new Local().get() : string +> : ^^^^^^ +>new Local().get : () => string +> : ^^^^^^^^^^^^ +>new Local() : Local +> : ^^^^^ +>Local : typeof Local +> : ^^^^^^^^^^^^ +>get : () => string +> : ^^^^^^^^^^^^ + + }, +}); + +const result5 = defineOptions({ +>result5 : [{ tag: string; value: number; }, any] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "E", value: 5 }, consume(_data) {}, produce() { function inner() { return this; } return inner(); },}) : [{ tag: string; value: number; }, any] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "E", value: 5 }, consume(_data) {}, produce() { function inner() { return this; } return inner(); },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: any): void; produce(): any; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "E", value: 5 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "E", value: 5 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"E" : "E" +> : ^^^ +>value : number +> : ^^^^^^ +>5 : 5 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: any) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ +>_data : any +> : ^^^ + + produce() { +>produce : () => any +> : ^^^^^^^^^ + + function inner() { +>inner : () => any +> : ^^^^^^^^^ + + return this; +>this : any +> : ^^^ + } + return inner(); +>inner() : any +> : ^^^ +>inner : () => any +> : ^^^^^^^^^ + + }, +}); + +const result6 = defineOptions({ +>result6 : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "F", value: 6 }, consume(_data) {}, produce() { const arrow = () => this.value; return arrow(); },}) : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "F", value: 6 }, consume(_data) {}, produce() { const arrow = () => this.value; return arrow(); },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: unknown): void; produce(this: { tag: string; value: number; }): number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "F", value: 6 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "F", value: 6 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"F" : "F" +> : ^^^ +>value : number +> : ^^^^^^ +>6 : 6 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: unknown) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +>_data : unknown +> : ^^^^^^^ + + produce() { +>produce : (this: { tag: string; value: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const arrow = () => this.value; +>arrow : () => number +> : ^^^^^^^^^^^^ +>() => this.value : () => number +> : ^^^^^^^^^^^^ +>this.value : number +> : ^^^^^^ +>this : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : number +> : ^^^^^^ + + return arrow(); +>arrow() : number +> : ^^^^^^ +>arrow : () => number +> : ^^^^^^^^^^^^ + + }, +}); + +const result7 = defineOptions({ +>result7 : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "G", value: 7 }, consume(_data) {}, produce() { const self = this; function inner() { return self.value; } return inner(); },}) : [{ tag: string; value: number; }, unknown] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "G", value: 7 }, consume(_data) {}, produce() { const self = this; function inner() { return self.value; } return inner(); },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: unknown): void; produce(this: { tag: string; value: number; }): number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "G", value: 7 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "G", value: 7 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"G" : "G" +> : ^^^ +>value : number +> : ^^^^^^ +>7 : 7 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: unknown) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +>_data : unknown +> : ^^^^^^^ + + produce() { +>produce : (this: { tag: string; value: number; }) => number +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + const self = this; +>self : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>this : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + function inner() { +>inner : () => number +> : ^^^^^^^^^^^^ + + return self.value; +>self.value : number +> : ^^^^^^ +>self : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : number +> : ^^^^^^ + } + return inner(); +>inner() : number +> : ^^^^^^ +>inner : () => number +> : ^^^^^^^^^^^^ + + }, +}); + +const result8 = defineOptions({ +>result8 : [{ tag: string; value: number; }, typeof globalThis] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "H", value: 8 }, consume(_data) {}, produce: () => { return this; },}) : [{ tag: string; value: number; }, typeof globalThis] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "H", value: 8 }, consume(_data) {}, produce: () => { return this; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: typeof globalThis): void; produce: () => typeof globalThis; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "H", value: 8 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "H", value: 8 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"H" : "H" +> : ^^^ +>value : number +> : ^^^^^^ +>8 : 8 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: typeof globalThis) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>_data : typeof globalThis +> : ^^^^^^^^^^^^^^^^^ + + produce: () => { +>produce : () => typeof globalThis +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>() => { return this; } : () => typeof globalThis +> : ^^^^^^^^^^^^^^^^^^^^^^^ + + return this; +>this : typeof globalThis +> : ^^^^^^^^^^^^^^^^^ + + }, +}); + +const result9 = defineOptions({ +>result9 : [{ tag: string; value: number; }, string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { const obj = { value: 'foo', get() { return this.value; }, }; return obj.get(); },}) : [{ tag: string; value: number; }, string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { const obj = { value: 'foo', get() { return this.value; }, }; return obj.get(); },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: string): void; produce(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "I", value: 9 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "I", value: 9 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"I" : "I" +> : ^^^ +>value : number +> : ^^^^^^ +>9 : 9 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: string) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ +>_data : string +> : ^^^^^^ + + produce() { +>produce : () => string +> : ^^^^^^^^^^^^ + + const obj = { +>obj : { value: string; get(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ value: 'foo', get() { return this.value; }, } : { value: string; get(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + value: 'foo', +>value : string +> : ^^^^^^ +>'foo' : "foo" +> : ^^^^^ + + get() { +>get : () => string +> : ^^^^^^^^^^^^ + + return this.value; +>this.value : string +> : ^^^^^^ +>this : { value: string; get(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : string +> : ^^^^^^ + + }, + }; + return obj.get(); +>obj.get() : string +> : ^^^^^^ +>obj.get : () => string +> : ^^^^^^^^^^^^ +>obj : { value: string; get(): string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>get : () => string +> : ^^^^^^^^^^^^ + + }, +}); + +const result10 = defineOptions({ +>result10 : [{ tag: string; value: number; }, Foo] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions({ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { interface Foo { prop: this; } return {} as Foo; },}) : [{ tag: string; value: number; }, Foo] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { interface Foo { prop: this; } return {} as Foo; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: Foo): void; produce(): Foo; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + context: { tag: "I", value: 9 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "I", value: 9 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"I" : "I" +> : ^^^ +>value : number +> : ^^^^^^ +>9 : 9 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: Foo) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ +>_data : Foo +> : ^^^ + + produce() { +>produce : () => Foo +> : ^^^^^^^^^ + + interface Foo { + prop: this; +>prop : this +> : ^^^^ + } + return {} as Foo; +>{} as Foo : Foo +> : ^^^ +>{} : {} +> : ^^ + + }, +}); + +const result11 = defineOptions({ +>result11 : [{ tag: string; value: number; }, (this: { prop: string; }) => string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^ +>defineOptions({ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { function fn(this: { prop: string }) { return this.prop; } return fn; },}) : [{ tag: string; value: number; }, (this: { prop: string; }) => string] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^ +>defineOptions : (options: Options) => [Context, Data] +> : ^ ^^ ^^ ^^ ^^^^^ +>{ context: { tag: "I", value: 9 }, consume(_data) {}, produce() { function fn(this: { prop: string }) { return this.prop; } return fn; },} : { context: { tag: string; value: number; }; consume(this: { tag: string; value: number; }, _data: (this: { prop: string; }) => string): void; produce(): (this: { prop: string; }) => string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ + + context: { tag: "I", value: 9 }, +>context : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ tag: "I", value: 9 } : { tag: string; value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>tag : string +> : ^^^^^^ +>"I" : "I" +> : ^^^ +>value : number +> : ^^^^^^ +>9 : 9 +> : ^ + + consume(_data) {}, +>consume : (this: { tag: string; value: number; }, _data: (this: { prop: string; }) => string) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +>_data : (this: { prop: string; }) => string +> : ^ ^^ ^^^^^^^^^^^ + + produce() { +>produce : () => (this: { prop: string; }) => string +> : ^^^^^^^ ^^ ^^^^^^^^^^^ + + function fn(this: { prop: string }) { +>fn : (this: { prop: string; }) => string +> : ^ ^^ ^^^^^^^^^^^ +>this : { prop: string; } +> : ^^^^^^^^ ^^^ +>prop : string +> : ^^^^^^ + + return this.prop; +>this.prop : string +> : ^^^^^^ +>this : { prop: string; } +> : ^^^^^^^^ ^^^ +>prop : string +> : ^^^^^^ + } + return fn; +>fn : (this: { prop: string; }) => string +> : ^ ^^ ^^^^^^^^^^^ + + }, +}); + diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive3.errors.txt b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.errors.txt new file mode 100644 index 0000000000000..7a4df0dd82493 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.errors.txt @@ -0,0 +1,130 @@ +thislessFunctionsNotContextSensitive3.ts(62,9): error TS2783: 'editor' is specified more than once, so this usage will be overwritten. +thislessFunctionsNotContextSensitive3.ts(81,9): error TS2783: 'editor' is specified more than once, so this usage will be overwritten. +thislessFunctionsNotContextSensitive3.ts(96,3): error TS2353: Object literal may only specify known properties, and 'child' does not exist in type 'Partial<{ parent: string; overwrite: string; }>'. +thislessFunctionsNotContextSensitive3.ts(108,3): error TS2353: Object literal may only specify known properties, and 'child' does not exist in type 'Partial<{ parent: string; overwrite: string; }>'. + + +==== thislessFunctionsNotContextSensitive3.ts (4 errors) ==== + declare class Editor { + private _editor; + } + + declare class Plugin { + private _plugin; + } + + type ParentConfig = Partial<{ + [P in keyof T]: Required[P] extends (...args: any) => any + ? (...args: Parameters[P]>) => ReturnType[P]> + : T[P]; + }>; + + interface ExtendableConfig< + Options = any, + Config extends + | ExtensionConfig + | ExtendableConfig = ExtendableConfig, + > { + name: string; + addOptions?: (this: { + name: string; + parent: ParentConfig["addOptions"]; + }) => Options; + addProseMirrorPlugins?: (this: { + options: Options; + editor: Editor; + }) => Plugin[]; + } + + interface ExtensionConfig + extends ExtendableConfig> {} + + declare class Extension { + _options: Options; + + static create(config: Partial>): Extension; + + configure(options?: Partial): Extension; + } + + interface SuggestionOptions { + editor: Editor; + char?: string; + } + + declare function Suggestion(options: SuggestionOptions): Plugin; + + Extension.create({ + name: "slash-command", + addOptions() { + return { + suggestion: { + char: "/", + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { + return [ + Suggestion({ + editor: this.editor, // error + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2783: 'editor' is specified more than once, so this usage will be overwritten. +!!! related TS2785 thislessFunctionsNotContextSensitive3.ts:63:9: This spread always overwrites this property. + ...this.options.suggestion, + }), + ]; + }, + }); + + Extension.create({ + name: "slash-command", + addOptions: () => { + return { + suggestion: { + char: "/", + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { + return [ + Suggestion({ + editor: this.editor, // error + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2783: 'editor' is specified more than once, so this usage will be overwritten. +!!! related TS2785 thislessFunctionsNotContextSensitive3.ts:82:9: This spread always overwrites this property. + ...this.options.suggestion, + }), + ]; + }, + }); + + const parentExtension = Extension.create({ + name: "parentExtension", + addOptions() { + return { parent: "exists", overwrite: "parent" }; + }, + }); + + const childExtension = parentExtension.configure({ + child: "exists-too", // error + ~~~~~ +!!! error TS2353: Object literal may only specify known properties, and 'child' does not exist in type 'Partial<{ parent: string; overwrite: string; }>'. + overwrite: "child", + }); + + const parentExtension2 = Extension.create({ + name: "parentExtension2", + addOptions: () => { + return { parent: "exists", overwrite: "parent" }; + }, + }); + + const childExtension2 = parentExtension2.configure({ + child: "exists-too", // error + ~~~~~ +!!! error TS2353: Object literal may only specify known properties, and 'child' does not exist in type 'Partial<{ parent: string; overwrite: string; }>'. + overwrite: "child", + }); + + export {}; + \ No newline at end of file diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive3.symbols b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.symbols new file mode 100644 index 0000000000000..8bb3cff42e1d1 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.symbols @@ -0,0 +1,319 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive3.ts] //// + +=== thislessFunctionsNotContextSensitive3.ts === +declare class Editor { +>Editor : Symbol(Editor, Decl(thislessFunctionsNotContextSensitive3.ts, 0, 0)) + + private _editor; +>_editor : Symbol(Editor._editor, Decl(thislessFunctionsNotContextSensitive3.ts, 0, 22)) +} + +declare class Plugin { +>Plugin : Symbol(Plugin, Decl(thislessFunctionsNotContextSensitive3.ts, 2, 1)) + + private _plugin; +>_plugin : Symbol(Plugin._plugin, Decl(thislessFunctionsNotContextSensitive3.ts, 4, 22)) +} + +type ParentConfig = Partial<{ +>ParentConfig : Symbol(ParentConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 6, 1)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) + + [P in keyof T]: Required[P] extends (...args: any) => any +>P : Symbol(P, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 3)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>Required : Symbol(Required, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>P : Symbol(P, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 3)) +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 42)) + + ? (...args: Parameters[P]>) => ReturnType[P]> +>args : Symbol(args, Decl(thislessFunctionsNotContextSensitive3.ts, 10, 7)) +>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) +>Required : Symbol(Required, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>P : Symbol(P, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 3)) +>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) +>Required : Symbol(Required, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>P : Symbol(P, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 3)) + + : T[P]; +>T : Symbol(T, Decl(thislessFunctionsNotContextSensitive3.ts, 8, 18)) +>P : Symbol(P, Decl(thislessFunctionsNotContextSensitive3.ts, 9, 3)) + +}>; + +interface ExtendableConfig< +>ExtendableConfig : Symbol(ExtendableConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 12, 3)) + + Options = any, +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) + + Config extends +>Config : Symbol(Config, Decl(thislessFunctionsNotContextSensitive3.ts, 15, 16)) + + | ExtensionConfig +>ExtensionConfig : Symbol(ExtensionConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 29, 1)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) + + | ExtendableConfig = ExtendableConfig, +>ExtendableConfig : Symbol(ExtendableConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 12, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) +>ExtendableConfig : Symbol(ExtendableConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 12, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) + +> { + name: string; +>name : Symbol(ExtendableConfig.name, Decl(thislessFunctionsNotContextSensitive3.ts, 19, 3)) + + addOptions?: (this: { +>addOptions : Symbol(ExtendableConfig.addOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 20, 15)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 21, 16)) + + name: string; +>name : Symbol(name, Decl(thislessFunctionsNotContextSensitive3.ts, 21, 23)) + + parent: ParentConfig["addOptions"]; +>parent : Symbol(parent, Decl(thislessFunctionsNotContextSensitive3.ts, 22, 17)) +>ParentConfig : Symbol(ParentConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 6, 1)) +>Config : Symbol(Config, Decl(thislessFunctionsNotContextSensitive3.ts, 15, 16)) + + }) => Options; +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) + + addProseMirrorPlugins?: (this: { +>addProseMirrorPlugins : Symbol(ExtendableConfig.addProseMirrorPlugins, Decl(thislessFunctionsNotContextSensitive3.ts, 24, 16)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 27)) + + options: Options; +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 34)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 14, 27)) + + editor: Editor; +>editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 26, 21)) +>Editor : Symbol(Editor, Decl(thislessFunctionsNotContextSensitive3.ts, 0, 0)) + + }) => Plugin[]; +>Plugin : Symbol(Plugin, Decl(thislessFunctionsNotContextSensitive3.ts, 2, 1)) +} + +interface ExtensionConfig +>ExtensionConfig : Symbol(ExtensionConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 29, 1)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 31, 26)) + + extends ExtendableConfig> {} +>ExtendableConfig : Symbol(ExtendableConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 12, 3)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 31, 26)) +>ExtensionConfig : Symbol(ExtensionConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 29, 1)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 31, 26)) + +declare class Extension { +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 34, 24)) + + _options: Options; +>_options : Symbol(Extension._options, Decl(thislessFunctionsNotContextSensitive3.ts, 34, 40)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 34, 24)) + + static create(config: Partial>): Extension; +>create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) +>O : Symbol(O, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 16)) +>config : Symbol(config, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 25)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>ExtensionConfig : Symbol(ExtensionConfig, Decl(thislessFunctionsNotContextSensitive3.ts, 29, 1)) +>O : Symbol(O, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 16)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>O : Symbol(O, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 16)) + + configure(options?: Partial): Extension; +>configure : Symbol(Extension.configure, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 76)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 39, 12)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 34, 24)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>Options : Symbol(Options, Decl(thislessFunctionsNotContextSensitive3.ts, 34, 24)) +} + +interface SuggestionOptions { +>SuggestionOptions : Symbol(SuggestionOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 40, 1)) + + editor: Editor; +>editor : Symbol(SuggestionOptions.editor, Decl(thislessFunctionsNotContextSensitive3.ts, 42, 29)) +>Editor : Symbol(Editor, Decl(thislessFunctionsNotContextSensitive3.ts, 0, 0)) + + char?: string; +>char : Symbol(SuggestionOptions.char, Decl(thislessFunctionsNotContextSensitive3.ts, 43, 17)) +} + +declare function Suggestion(options: SuggestionOptions): Plugin; +>Suggestion : Symbol(Suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 45, 1)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 47, 28)) +>SuggestionOptions : Symbol(SuggestionOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 40, 1)) +>Plugin : Symbol(Plugin, Decl(thislessFunctionsNotContextSensitive3.ts, 2, 1)) + +Extension.create({ +>Extension.create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) + + name: "slash-command", +>name : Symbol(name, Decl(thislessFunctionsNotContextSensitive3.ts, 49, 18)) + + addOptions() { +>addOptions : Symbol(addOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 50, 24)) + + return { + suggestion: { +>suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 52, 12)) + + char: "/", +>char : Symbol(char, Decl(thislessFunctionsNotContextSensitive3.ts, 53, 19)) + + } as SuggestionOptions, +>SuggestionOptions : Symbol(SuggestionOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 40, 1)) + + }; + }, + addProseMirrorPlugins() { +>addProseMirrorPlugins : Symbol(addProseMirrorPlugins, Decl(thislessFunctionsNotContextSensitive3.ts, 57, 4)) + + return [ + Suggestion({ +>Suggestion : Symbol(Suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 45, 1)) + + editor: this.editor, // error +>editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 60, 18)) +>this.editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 26, 21)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 27)) +>editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 26, 21)) + + ...this.options.suggestion, +>this.options.suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 52, 12)) +>this.options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 34)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 27)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 34)) +>suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 52, 12)) + + }), + ]; + }, +}); + +Extension.create({ +>Extension.create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) + + name: "slash-command", +>name : Symbol(name, Decl(thislessFunctionsNotContextSensitive3.ts, 68, 18)) + + addOptions: () => { +>addOptions : Symbol(addOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 69, 24)) + + return { + suggestion: { +>suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 71, 12)) + + char: "/", +>char : Symbol(char, Decl(thislessFunctionsNotContextSensitive3.ts, 72, 19)) + + } as SuggestionOptions, +>SuggestionOptions : Symbol(SuggestionOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 40, 1)) + + }; + }, + addProseMirrorPlugins() { +>addProseMirrorPlugins : Symbol(addProseMirrorPlugins, Decl(thislessFunctionsNotContextSensitive3.ts, 76, 4)) + + return [ + Suggestion({ +>Suggestion : Symbol(Suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 45, 1)) + + editor: this.editor, // error +>editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 79, 18)) +>this.editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 26, 21)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 27)) +>editor : Symbol(editor, Decl(thislessFunctionsNotContextSensitive3.ts, 26, 21)) + + ...this.options.suggestion, +>this.options.suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 71, 12)) +>this.options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 34)) +>this : Symbol(this, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 27)) +>options : Symbol(options, Decl(thislessFunctionsNotContextSensitive3.ts, 25, 34)) +>suggestion : Symbol(suggestion, Decl(thislessFunctionsNotContextSensitive3.ts, 71, 12)) + + }), + ]; + }, +}); + +const parentExtension = Extension.create({ +>parentExtension : Symbol(parentExtension, Decl(thislessFunctionsNotContextSensitive3.ts, 87, 5)) +>Extension.create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) + + name: "parentExtension", +>name : Symbol(name, Decl(thislessFunctionsNotContextSensitive3.ts, 87, 42)) + + addOptions() { +>addOptions : Symbol(addOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 88, 26)) + + return { parent: "exists", overwrite: "parent" }; +>parent : Symbol(parent, Decl(thislessFunctionsNotContextSensitive3.ts, 90, 12)) +>overwrite : Symbol(overwrite, Decl(thislessFunctionsNotContextSensitive3.ts, 90, 30)) + + }, +}); + +const childExtension = parentExtension.configure({ +>childExtension : Symbol(childExtension, Decl(thislessFunctionsNotContextSensitive3.ts, 94, 5)) +>parentExtension.configure : Symbol(Extension.configure, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 76)) +>parentExtension : Symbol(parentExtension, Decl(thislessFunctionsNotContextSensitive3.ts, 87, 5)) +>configure : Symbol(Extension.configure, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 76)) + + child: "exists-too", // error +>child : Symbol(child, Decl(thislessFunctionsNotContextSensitive3.ts, 94, 50)) + + overwrite: "child", +>overwrite : Symbol(overwrite, Decl(thislessFunctionsNotContextSensitive3.ts, 95, 22)) + +}); + +const parentExtension2 = Extension.create({ +>parentExtension2 : Symbol(parentExtension2, Decl(thislessFunctionsNotContextSensitive3.ts, 99, 5)) +>Extension.create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) +>Extension : Symbol(Extension, Decl(thislessFunctionsNotContextSensitive3.ts, 32, 64)) +>create : Symbol(Extension.create, Decl(thislessFunctionsNotContextSensitive3.ts, 35, 20)) + + name: "parentExtension2", +>name : Symbol(name, Decl(thislessFunctionsNotContextSensitive3.ts, 99, 43)) + + addOptions: () => { +>addOptions : Symbol(addOptions, Decl(thislessFunctionsNotContextSensitive3.ts, 100, 27)) + + return { parent: "exists", overwrite: "parent" }; +>parent : Symbol(parent, Decl(thislessFunctionsNotContextSensitive3.ts, 102, 12)) +>overwrite : Symbol(overwrite, Decl(thislessFunctionsNotContextSensitive3.ts, 102, 30)) + + }, +}); + +const childExtension2 = parentExtension2.configure({ +>childExtension2 : Symbol(childExtension2, Decl(thislessFunctionsNotContextSensitive3.ts, 106, 5)) +>parentExtension2.configure : Symbol(Extension.configure, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 76)) +>parentExtension2 : Symbol(parentExtension2, Decl(thislessFunctionsNotContextSensitive3.ts, 99, 5)) +>configure : Symbol(Extension.configure, Decl(thislessFunctionsNotContextSensitive3.ts, 37, 76)) + + child: "exists-too", // error +>child : Symbol(child, Decl(thislessFunctionsNotContextSensitive3.ts, 106, 52)) + + overwrite: "child", +>overwrite : Symbol(overwrite, Decl(thislessFunctionsNotContextSensitive3.ts, 107, 22)) + +}); + +export {}; + diff --git a/tests/baselines/reference/thislessFunctionsNotContextSensitive3.types b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.types new file mode 100644 index 0000000000000..b443986aa7b10 --- /dev/null +++ b/tests/baselines/reference/thislessFunctionsNotContextSensitive3.types @@ -0,0 +1,430 @@ +//// [tests/cases/compiler/thislessFunctionsNotContextSensitive3.ts] //// + +=== thislessFunctionsNotContextSensitive3.ts === +declare class Editor { +>Editor : Editor +> : ^^^^^^ + + private _editor; +>_editor : any +> : ^^^ +} + +declare class Plugin { +>Plugin : Plugin +> : ^^^^^^ + + private _plugin; +>_plugin : any +> : ^^^ +} + +type ParentConfig = Partial<{ +>ParentConfig : Partial<{ [P in keyof T]: Required[P] extends (...args: any) => any ? (...args: Parameters[P]>) => ReturnType[P]> : T[P]; }> +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^ + + [P in keyof T]: Required[P] extends (...args: any) => any +>args : any +> : ^^^ + + ? (...args: Parameters[P]>) => ReturnType[P]> +>args : Parameters[P]> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ + + : T[P]; +}>; + +interface ExtendableConfig< + Options = any, + Config extends + | ExtensionConfig + | ExtendableConfig = ExtendableConfig, +> { + name: string; +>name : string +> : ^^^^^^ + + addOptions?: (this: { +>addOptions : ((this: { name: string; parent: ParentConfig["addOptions"]; }) => Options) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ +>this : { name: string; parent: ParentConfig["addOptions"]; } +> : ^^^^^^^^ ^^^^^^^^^^ ^^^ + + name: string; +>name : string +> : ^^^^^^ + + parent: ParentConfig["addOptions"]; +>parent : Partial<{ [P in keyof Config]: Required[P] extends (...args: any) => any ? (...args: Parameters[P]>) => ReturnType[P]> : Config[P]; }>["addOptions"] +> : ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + }) => Options; + addProseMirrorPlugins?: (this: { +>addProseMirrorPlugins : ((this: { options: Options; editor: Editor; }) => Plugin[]) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ +>this : { options: Options; editor: Editor; } +> : ^^^^^^^^^^^ ^^^^^^^^^^ ^^^ + + options: Options; +>options : Options +> : ^^^^^^^ + + editor: Editor; +>editor : Editor +> : ^^^^^^ + + }) => Plugin[]; +} + +interface ExtensionConfig + extends ExtendableConfig> {} + +declare class Extension { +>Extension : Extension +> : ^^^^^^^^^^^^^^^^^^ + + _options: Options; +>_options : Options +> : ^^^^^^^ + + static create(config: Partial>): Extension; +>create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>config : Partial> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + configure(options?: Partial): Extension; +>configure : (options?: Partial) => Extension +> : ^ ^^^ ^^^^^ +>options : Partial | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + +interface SuggestionOptions { + editor: Editor; +>editor : Editor +> : ^^^^^^ + + char?: string; +>char : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +} + +declare function Suggestion(options: SuggestionOptions): Plugin; +>Suggestion : (options: SuggestionOptions) => Plugin +> : ^ ^^ ^^^^^ +>options : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ + +Extension.create({ +>Extension.create({ name: "slash-command", addOptions() { return { suggestion: { char: "/", } as SuggestionOptions, }; }, addProseMirrorPlugins() { return [ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ]; },}) : Extension<{ suggestion: SuggestionOptions; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>Extension.create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>Extension : typeof Extension +> : ^^^^^^^^^^^^^^^^ +>create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>{ name: "slash-command", addOptions() { return { suggestion: { char: "/", } as SuggestionOptions, }; }, addProseMirrorPlugins() { return [ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ]; },} : { name: string; addOptions(): { suggestion: SuggestionOptions; }; addProseMirrorPlugins(this: { options: { suggestion: SuggestionOptions; }; editor: Editor; }): Plugin[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ + + name: "slash-command", +>name : string +> : ^^^^^^ +>"slash-command" : "slash-command" +> : ^^^^^^^^^^^^^^^ + + addOptions() { +>addOptions : () => { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^ + + return { +>{ suggestion: { char: "/", } as SuggestionOptions, } : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ + + suggestion: { +>suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>{ char: "/", } as SuggestionOptions : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>{ char: "/", } : { char: string; } +> : ^^^^^^^^^^^^^^^^^ + + char: "/", +>char : string +> : ^^^^^^ +>"/" : "/" +> : ^^^ + + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { +>addProseMirrorPlugins : (this: { options: { suggestion: SuggestionOptions; }; editor: Editor; }) => Plugin[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ + + return [ +>[ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ] : Plugin[] +> : ^^^^^^^^ + + Suggestion({ +>Suggestion({ editor: this.editor, // error ...this.options.suggestion, }) : Plugin +> : ^^^^^^ +>Suggestion : (options: SuggestionOptions) => Plugin +> : ^ ^^ ^^^^^ +>{ editor: this.editor, // error ...this.options.suggestion, } : { editor: Editor; char?: string; } +> : ^^^^^^^^^^ ^^^^^^^^^ ^^^ + + editor: this.editor, // error +>editor : Editor +> : ^^^^^^ +>this.editor : Editor +> : ^^^^^^ +>this : { options: { suggestion: SuggestionOptions; }; editor: Editor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^ +>editor : Editor +> : ^^^^^^ + + ...this.options.suggestion, +>this.options.suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>this.options : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ +>this : { options: { suggestion: SuggestionOptions; }; editor: Editor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^ +>options : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ +>suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ + + }), + ]; + }, +}); + +Extension.create({ +>Extension.create({ name: "slash-command", addOptions: () => { return { suggestion: { char: "/", } as SuggestionOptions, }; }, addProseMirrorPlugins() { return [ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ]; },}) : Extension<{ suggestion: SuggestionOptions; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>Extension.create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>Extension : typeof Extension +> : ^^^^^^^^^^^^^^^^ +>create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>{ name: "slash-command", addOptions: () => { return { suggestion: { char: "/", } as SuggestionOptions, }; }, addProseMirrorPlugins() { return [ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ]; },} : { name: string; addOptions: () => { suggestion: SuggestionOptions; }; addProseMirrorPlugins(this: { options: { suggestion: SuggestionOptions; }; editor: Editor; }): Plugin[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ + + name: "slash-command", +>name : string +> : ^^^^^^ +>"slash-command" : "slash-command" +> : ^^^^^^^^^^^^^^^ + + addOptions: () => { +>addOptions : () => { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^ +>() => { return { suggestion: { char: "/", } as SuggestionOptions, }; } : () => { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^ + + return { +>{ suggestion: { char: "/", } as SuggestionOptions, } : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ + + suggestion: { +>suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>{ char: "/", } as SuggestionOptions : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>{ char: "/", } : { char: string; } +> : ^^^^^^^^^^^^^^^^^ + + char: "/", +>char : string +> : ^^^^^^ +>"/" : "/" +> : ^^^ + + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { +>addProseMirrorPlugins : (this: { options: { suggestion: SuggestionOptions; }; editor: Editor; }) => Plugin[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ + + return [ +>[ Suggestion({ editor: this.editor, // error ...this.options.suggestion, }), ] : Plugin[] +> : ^^^^^^^^ + + Suggestion({ +>Suggestion({ editor: this.editor, // error ...this.options.suggestion, }) : Plugin +> : ^^^^^^ +>Suggestion : (options: SuggestionOptions) => Plugin +> : ^ ^^ ^^^^^ +>{ editor: this.editor, // error ...this.options.suggestion, } : { editor: Editor; char?: string; } +> : ^^^^^^^^^^ ^^^^^^^^^ ^^^ + + editor: this.editor, // error +>editor : Editor +> : ^^^^^^ +>this.editor : Editor +> : ^^^^^^ +>this : { options: { suggestion: SuggestionOptions; }; editor: Editor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^ +>editor : Editor +> : ^^^^^^ + + ...this.options.suggestion, +>this.options.suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ +>this.options : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ +>this : { options: { suggestion: SuggestionOptions; }; editor: Editor; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^ +>options : { suggestion: SuggestionOptions; } +> : ^^^^^^^^^^^^^^ ^^^ +>suggestion : SuggestionOptions +> : ^^^^^^^^^^^^^^^^^ + + }), + ]; + }, +}); + +const parentExtension = Extension.create({ +>parentExtension : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Extension.create({ name: "parentExtension", addOptions() { return { parent: "exists", overwrite: "parent" }; },}) : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Extension.create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>Extension : typeof Extension +> : ^^^^^^^^^^^^^^^^ +>create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>{ name: "parentExtension", addOptions() { return { parent: "exists", overwrite: "parent" }; },} : { name: string; addOptions(): { parent: string; overwrite: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + name: "parentExtension", +>name : string +> : ^^^^^^ +>"parentExtension" : "parentExtension" +> : ^^^^^^^^^^^^^^^^^ + + addOptions() { +>addOptions : () => { parent: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { parent: "exists", overwrite: "parent" }; +>{ parent: "exists", overwrite: "parent" } : { parent: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parent : string +> : ^^^^^^ +>"exists" : "exists" +> : ^^^^^^^^ +>overwrite : string +> : ^^^^^^ +>"parent" : "parent" +> : ^^^^^^^^ + + }, +}); + +const childExtension = parentExtension.configure({ +>childExtension : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension.configure({ child: "exists-too", // error overwrite: "child",}) : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension.configure : (options?: Partial<{ parent: string; overwrite: string; }> | undefined) => Extension<{ parent: string; overwrite: string; }> +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>configure : (options?: Partial<{ parent: string; overwrite: string; }> | undefined) => Extension<{ parent: string; overwrite: string; }> +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ child: "exists-too", // error overwrite: "child",} : { child: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + child: "exists-too", // error +>child : string +> : ^^^^^^ +>"exists-too" : "exists-too" +> : ^^^^^^^^^^^^ + + overwrite: "child", +>overwrite : string +> : ^^^^^^ +>"child" : "child" +> : ^^^^^^^ + +}); + +const parentExtension2 = Extension.create({ +>parentExtension2 : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Extension.create({ name: "parentExtension2", addOptions: () => { return { parent: "exists", overwrite: "parent" }; },}) : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Extension.create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>Extension : typeof Extension +> : ^^^^^^^^^^^^^^^^ +>create : (config: Partial>) => Extension +> : ^ ^^^^^^^^ ^^ ^^^^^ +>{ name: "parentExtension2", addOptions: () => { return { parent: "exists", overwrite: "parent" }; },} : { name: string; addOptions: () => { parent: string; overwrite: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + name: "parentExtension2", +>name : string +> : ^^^^^^ +>"parentExtension2" : "parentExtension2" +> : ^^^^^^^^^^^^^^^^^^ + + addOptions: () => { +>addOptions : () => { parent: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>() => { return { parent: "exists", overwrite: "parent" }; } : () => { parent: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { parent: "exists", overwrite: "parent" }; +>{ parent: "exists", overwrite: "parent" } : { parent: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parent : string +> : ^^^^^^ +>"exists" : "exists" +> : ^^^^^^^^ +>overwrite : string +> : ^^^^^^ +>"parent" : "parent" +> : ^^^^^^^^ + + }, +}); + +const childExtension2 = parentExtension2.configure({ +>childExtension2 : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension2.configure({ child: "exists-too", // error overwrite: "child",}) : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension2.configure : (options?: Partial<{ parent: string; overwrite: string; }> | undefined) => Extension<{ parent: string; overwrite: string; }> +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>parentExtension2 : Extension<{ parent: string; overwrite: string; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>configure : (options?: Partial<{ parent: string; overwrite: string; }> | undefined) => Extension<{ parent: string; overwrite: string; }> +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ child: "exists-too", // error overwrite: "child",} : { child: string; overwrite: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + child: "exists-too", // error +>child : string +> : ^^^^^^ +>"exists-too" : "exists-too" +> : ^^^^^^^^^^^^ + + overwrite: "child", +>overwrite : string +> : ^^^^^^ +>"child" : "child" +> : ^^^^^^^ + +}); + +export {}; + diff --git a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index 3287485f769a9..12729b55ad4fe 100644 --- a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -67,6 +67,9 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + --build, -b Build one or more projects and their dependencies, if out of date diff --git a/tests/baselines/reference/tsc/commandLine/help-all.js b/tests/baselines/reference/tsc/commandLine/help-all.js index e9b06fca35128..f0a4d50e418a5 100644 --- a/tests/baselines/reference/tsc/commandLine/help-all.js +++ b/tests/baselines/reference/tsc/commandLine/help-all.js @@ -35,6 +35,9 @@ Print this message. --help, -? +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + --init Initializes a TypeScript project and creates a tsconfig.json file. diff --git a/tests/baselines/reference/tsc/commandLine/help.js b/tests/baselines/reference/tsc/commandLine/help.js index 5d813efbed7df..22cd46fc2a7a4 100644 --- a/tests/baselines/reference/tsc/commandLine/help.js +++ b/tests/baselines/reference/tsc/commandLine/help.js @@ -66,6 +66,9 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + --build, -b Build one or more projects and their dependencies, if out of date diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 2d4298e0c357f..6341254d3e748 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -67,6 +67,9 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + --build, -b Build one or more projects and their dependencies, if out of date diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 2d4298e0c357f..6341254d3e748 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -67,6 +67,9 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + --build, -b Build one or more projects and their dependencies, if out of date diff --git a/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js new file mode 100644 index 0000000000000..c3afdbb68ff6b --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js @@ -0,0 +1,33 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js -p . src/a.ts c.ts --ignoreConfig +Output:: +error TS5042: Option 'project' cannot be mixed with source files on a command line. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js new file mode 100644 index 0000000000000..18356d0a1ac9e --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js @@ -0,0 +1,33 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js -p . src/a.ts c.ts +Output:: +error TS5042: Option 'project' cannot be mixed with source files on a command line. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js new file mode 100644 index 0000000000000..fade1ebb4ba57 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js @@ -0,0 +1,40 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js -p . src/a.ts c.ts --ignoreConfig +Output:: +error TS5042: Option 'project' cannot be mixed with source files on a command line. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js new file mode 100644 index 0000000000000..2991c1d479382 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js @@ -0,0 +1,40 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js -p . src/a.ts c.ts +Output:: +error TS5042: Option 'project' cannot be mixed with source files on a command line. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent-with---ignoreConfig.js new file mode 100644 index 0000000000000..a2d3630d02462 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent-with---ignoreConfig.js @@ -0,0 +1,39 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js src/a.ts --ignoreConfig +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent.js new file mode 100644 index 0000000000000..72ee85b0a2744 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-when-config-file-absent.js @@ -0,0 +1,39 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js src/a.ts +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-files-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-with---ignoreConfig.js new file mode 100644 index 0000000000000..e4196077b3396 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-files-with---ignoreConfig.js @@ -0,0 +1,46 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js src/a.ts --ignoreConfig +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-files.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-files.js new file mode 100644 index 0000000000000..10aada22589dd --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-files.js @@ -0,0 +1,40 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js src/a.ts +Output:: +error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js new file mode 100644 index 0000000000000..576b0eb4c2d36 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js @@ -0,0 +1,33 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js -p . --ignoreConfig +Output:: +error TS5057: Cannot find a tsconfig.json file at the specified directory: '.'. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js new file mode 100644 index 0000000000000..efedeaf7cdc80 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js @@ -0,0 +1,33 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js -p . +Output:: +error TS5057: Cannot find a tsconfig.json file at the specified directory: '.'. + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-project-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-with---ignoreConfig.js new file mode 100644 index 0000000000000..20402ba5337e3 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-project-with---ignoreConfig.js @@ -0,0 +1,53 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js -p . --ignoreConfig +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + +//// [/home/src/workspaces/project/src/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/specifying-project.js b/tests/baselines/reference/tsc/ignoreConfig/specifying-project.js new file mode 100644 index 0000000000000..2f596a54fcbe4 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/specifying-project.js @@ -0,0 +1,53 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js -p . +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + +//// [/home/src/workspaces/project/src/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js new file mode 100644 index 0000000000000..1fa6fdc7af707 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js @@ -0,0 +1,176 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js --ignoreConfig +Output:: +Version FakeTSVersion +tsc: The TypeScript Compiler - Version FakeTSVersion + +COMMON COMMANDS + + tsc + Compiles the current project (tsconfig.json in the working directory.) + + tsc app.ts util.ts + Ignoring tsconfig.json, compiles the specified files with default compiler options. + + tsc -b + Build a composite project in the working directory. + + tsc --init + Creates a tsconfig.json with the recommended settings in the working directory. + + tsc -p ./path/to/tsconfig.json + Compiles the TypeScript project located at the specified path. + + tsc --help --all + An expanded version of this information, showing all possible compiler options + + tsc --noEmit + tsc --target esnext + Compiles the current project, with additional settings. + +COMMAND LINE FLAGS + +--help, -h +Print this message. + +--watch, -w +Watch input files. + +--all +Show all compiler options. + +--version, -v +Print the compiler's version. + +--init +Initializes a TypeScript project and creates a tsconfig.json file. + +--project, -p +Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'. + +--showConfig +Print the final configuration instead of building. + +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + +--build, -b +Build one or more projects and their dependencies, if out of date + +COMMON COMPILER OPTIONS + +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + +--target, -t +Set the JavaScript language version for emitted JavaScript and include compatible library declarations. +one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext +default: es5 + +--module, -m +Specify what module code is generated. +one of: commonjs, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve +default: undefined + +--lib +Specify a set of bundled library declaration files that describe the target runtime environment. +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +default: undefined + +--allowJs +Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files. +type: boolean +default: `false`, unless `checkJs` is set + +--checkJs +Enable error reporting in type-checked JavaScript files. +type: boolean +default: false + +--jsx +Specify what JSX code is generated. +one of: preserve, react, react-native, react-jsx, react-jsxdev +default: undefined + +--outFile +Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. + +--outDir +Specify an output folder for all emitted files. + +--removeComments +Disable emitting comments. +type: boolean +default: false + +--strict +Enable all strict type-checking options. +type: boolean +default: false + +--types +Specify type package names to be included without being referenced in a source file. + +--esModuleInterop +Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. +type: boolean +default: true + +You can learn about all of the compiler options at https://aka.ms/tsc + + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js new file mode 100644 index 0000000000000..1fcbaf3afb591 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js @@ -0,0 +1,176 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/home/src/tslibs/TS/Lib/tsc.js +Output:: +Version FakeTSVersion +tsc: The TypeScript Compiler - Version FakeTSVersion + +COMMON COMMANDS + + tsc + Compiles the current project (tsconfig.json in the working directory.) + + tsc app.ts util.ts + Ignoring tsconfig.json, compiles the specified files with default compiler options. + + tsc -b + Build a composite project in the working directory. + + tsc --init + Creates a tsconfig.json with the recommended settings in the working directory. + + tsc -p ./path/to/tsconfig.json + Compiles the TypeScript project located at the specified path. + + tsc --help --all + An expanded version of this information, showing all possible compiler options + + tsc --noEmit + tsc --target esnext + Compiles the current project, with additional settings. + +COMMAND LINE FLAGS + +--help, -h +Print this message. + +--watch, -w +Watch input files. + +--all +Show all compiler options. + +--version, -v +Print the compiler's version. + +--init +Initializes a TypeScript project and creates a tsconfig.json file. + +--project, -p +Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'. + +--showConfig +Print the final configuration instead of building. + +--ignoreConfig +Ignore the tsconfig found and build with commandline options and files. + +--build, -b +Build one or more projects and their dependencies, if out of date + +COMMON COMPILER OPTIONS + +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + +--target, -t +Set the JavaScript language version for emitted JavaScript and include compatible library declarations. +one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext +default: es5 + +--module, -m +Specify what module code is generated. +one of: commonjs, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve +default: undefined + +--lib +Specify a set of bundled library declaration files that describe the target runtime environment. +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.arraybuffer, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.string, es2022.regexp, es2023.array, es2023.collection, es2023.intl, es2024.arraybuffer, es2024.collection, es2024.object/esnext.object, es2024.promise, es2024.regexp/esnext.regexp, es2024.sharedmemory, es2024.string/esnext.string, esnext.array, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.iterator, esnext.float16, esnext.typedarrays, esnext.error, esnext.sharedmemory, decorators, decorators.legacy +default: undefined + +--allowJs +Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files. +type: boolean +default: `false`, unless `checkJs` is set + +--checkJs +Enable error reporting in type-checked JavaScript files. +type: boolean +default: false + +--jsx +Specify what JSX code is generated. +one of: preserve, react, react-native, react-jsx, react-jsxdev +default: undefined + +--outFile +Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. + +--outDir +Specify an output folder for all emitted files. + +--removeComments +Disable emitting comments. +type: boolean +default: false + +--strict +Enable all strict type-checking options. +type: boolean +default: false + +--types +Specify type package names to be included without being referenced in a source file. + +--esModuleInterop +Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. +type: boolean +default: true + +You can learn about all of the compiler options at https://aka.ms/tsc + + + + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options-with---ignoreConfig.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-with---ignoreConfig.js new file mode 100644 index 0000000000000..9de2d8f0387c7 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options-with---ignoreConfig.js @@ -0,0 +1,53 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js --ignoreConfig +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + +//// [/home/src/workspaces/project/src/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsc/ignoreConfig/without-any-options.js b/tests/baselines/reference/tsc/ignoreConfig/without-any-options.js new file mode 100644 index 0000000000000..57960b2c91698 --- /dev/null +++ b/tests/baselines/reference/tsc/ignoreConfig/without-any-options.js @@ -0,0 +1,53 @@ +currentDirectory:: /home/src/workspaces/project useCaseSensitiveFileNames:: false +Input:: +//// [/home/src/workspaces/project/src/a.ts] +export const a = 10; + +//// [/home/src/workspaces/project/src/b.ts] +export const b = 10; + +//// [/home/src/workspaces/project/c.ts] +export const c = 10; + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "include": [ + "src" + ] +} + + +/home/src/tslibs/TS/Lib/tsc.js +Output:: + + +//// [/home/src/workspaces/project/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + + +//// [/home/src/workspaces/project/src/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + +exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js index 5a1c6045b181a..e50b2d7601caa 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js @@ -24,7 +24,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/home/src/tslibs/TS/Lib/tsc.js --w /user/username/projects/myproject/test.ts +/home/src/tslibs/TS/Lib/tsc.js --w --ignoreConfig /user/username/projects/myproject/test.ts Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -73,7 +73,8 @@ Program root files: [ "/user/username/projects/myproject/test.ts" ] Program options: { - "watch": true + "watch": true, + "ignoreConfig": true } Program structureReused: Not Program files:: diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.js b/tests/baselines/reference/unexportedInstanceClassVariables.js index d807bcfc3c4f2..ef47f868403fa 100644 --- a/tests/baselines/reference/unexportedInstanceClassVariables.js +++ b/tests/baselines/reference/unexportedInstanceClassVariables.js @@ -1,13 +1,13 @@ //// [tests/cases/compiler/unexportedInstanceClassVariables.ts] //// //// [unexportedInstanceClassVariables.ts] -module M{ +namespace M{ class A{ constructor(val:string){} } } -module M{ +namespace M{ class A {} var a = new A(); diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.symbols b/tests/baselines/reference/unexportedInstanceClassVariables.symbols index 22099e203d41f..2984600d95964 100644 --- a/tests/baselines/reference/unexportedInstanceClassVariables.symbols +++ b/tests/baselines/reference/unexportedInstanceClassVariables.symbols @@ -1,25 +1,25 @@ //// [tests/cases/compiler/unexportedInstanceClassVariables.ts] //// === unexportedInstanceClassVariables.ts === -module M{ +namespace M{ >M : Symbol(M, Decl(unexportedInstanceClassVariables.ts, 0, 0), Decl(unexportedInstanceClassVariables.ts, 4, 1)) class A{ ->A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 0, 9)) +>A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 0, 12)) constructor(val:string){} >val : Symbol(val, Decl(unexportedInstanceClassVariables.ts, 2, 14)) } } -module M{ +namespace M{ >M : Symbol(M, Decl(unexportedInstanceClassVariables.ts, 0, 0), Decl(unexportedInstanceClassVariables.ts, 4, 1)) class A {} ->A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 6, 9)) +>A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 6, 12)) var a = new A(); >a : Symbol(a, Decl(unexportedInstanceClassVariables.ts, 9, 5)) ->A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 6, 9)) +>A : Symbol(A, Decl(unexportedInstanceClassVariables.ts, 6, 12)) } diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.types b/tests/baselines/reference/unexportedInstanceClassVariables.types index 1377e17dc10a2..4457806b25916 100644 --- a/tests/baselines/reference/unexportedInstanceClassVariables.types +++ b/tests/baselines/reference/unexportedInstanceClassVariables.types @@ -1,7 +1,7 @@ //// [tests/cases/compiler/unexportedInstanceClassVariables.ts] //// === unexportedInstanceClassVariables.ts === -module M{ +namespace M{ >M : typeof M > : ^^^^^^^^ @@ -15,7 +15,7 @@ module M{ } } -module M{ +namespace M{ >M : typeof M > : ^^^^^^^^ diff --git a/tests/baselines/reference/usingDeclarations.1(target=es2015).js b/tests/baselines/reference/usingDeclarations.1(target=es2015).js index e007092478438..a58fdc67cc347 100644 --- a/tests/baselines/reference/usingDeclarations.1(target=es2015).js +++ b/tests/baselines/reference/usingDeclarations.1(target=es2015).js @@ -94,61 +94,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; @@ -230,348 +241,347 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar }; var _a; function f() { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d2 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + const d2 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - __disposeResources(env_15); + __disposeResources(env_18); } } function af() { return __awaiter(this, void 0, void 0, function* () { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + const d3 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); yield null; } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - __disposeResources(env_16); + __disposeResources(env_19); } }); } function* g() { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d4 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + const d4 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); yield; } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - __disposeResources(env_17); + __disposeResources(env_20); } } function ag() { return __asyncGenerator(this, arguments, function* ag_1() { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); + const d5 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); yield yield __await(void 0); yield __await(null); } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - __disposeResources(env_18); + __disposeResources(env_21); } }); } -var d1, a, C1, C2, C3, N, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1, C2, C3, N; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); + d1 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); a = () => { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); + const d6 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - __disposeResources(env_19); + __disposeResources(env_22); } }; C1 = (_a = class C1 { constructor() { this.a = () => { - const env_21 = { stack: [], error: void 0, hasError: false }; + const env_24 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); + const d7 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); } - catch (e_21) { - env_21.error = e_21; - env_21.hasError = true; + catch (e_24) { + env_24.error = e_24; + env_24.hasError = true; } finally { - __disposeResources(env_21); + __disposeResources(env_24); } }; - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d8 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); + const d8 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - __disposeResources(env_20); + __disposeResources(env_23); } } m() { - const env_22 = { stack: [], error: void 0, hasError: false }; + const env_25 = { stack: [], error: void 0, hasError: false }; try { - const d10 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); + const d10 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); } - catch (e_22) { - env_22.error = e_22; - env_22.hasError = true; + catch (e_25) { + env_25.error = e_25; + env_25.hasError = true; } finally { - __disposeResources(env_22); + __disposeResources(env_25); } } get x() { - const env_23 = { stack: [], error: void 0, hasError: false }; + const env_26 = { stack: [], error: void 0, hasError: false }; try { - const d11 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); + const d11 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); return 0; } - catch (e_23) { - env_23.error = e_23; - env_23.hasError = true; + catch (e_26) { + env_26.error = e_26; + env_26.hasError = true; } finally { - __disposeResources(env_23); + __disposeResources(env_26); } } set x(v) { - const env_24 = { stack: [], error: void 0, hasError: false }; + const env_27 = { stack: [], error: void 0, hasError: false }; try { - const d12 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); + const d12 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); } - catch (e_24) { - env_24.error = e_24; - env_24.hasError = true; + catch (e_27) { + env_27.error = e_27; + env_27.hasError = true; } finally { - __disposeResources(env_24); + __disposeResources(env_27); } } am() { return __awaiter(this, void 0, void 0, function* () { - const env_25 = { stack: [], error: void 0, hasError: false }; + const env_28 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); + const d13 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); yield null; } - catch (e_25) { - env_25.error = e_25; - env_25.hasError = true; + catch (e_28) { + env_28.error = e_28; + env_28.hasError = true; } finally { - __disposeResources(env_25); + __disposeResources(env_28); } }); } *g() { - const env_26 = { stack: [], error: void 0, hasError: false }; + const env_29 = { stack: [], error: void 0, hasError: false }; try { - const d14 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); + const d14 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); yield; } - catch (e_26) { - env_26.error = e_26; - env_26.hasError = true; + catch (e_29) { + env_29.error = e_29; + env_29.hasError = true; } finally { - __disposeResources(env_26); + __disposeResources(env_29); } } ag() { return __asyncGenerator(this, arguments, function* ag_2() { - const env_27 = { stack: [], error: void 0, hasError: false }; + const env_30 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); + const d15 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); yield yield __await(void 0); yield __await(null); } - catch (e_27) { - env_27.error = e_27; - env_27.hasError = true; + catch (e_30) { + env_30.error = e_30; + env_30.hasError = true; } finally { - __disposeResources(env_27); + __disposeResources(env_30); } }); } }, (() => { - const env_28 = { stack: [], error: void 0, hasError: false }; + const env_31 = { stack: [], error: void 0, hasError: false }; try { - const d9 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); + const d9 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); } - catch (e_28) { - env_28.error = e_28; - env_28.hasError = true; + catch (e_31) { + env_31.error = e_31; + env_31.hasError = true; } finally { - __disposeResources(env_28); + __disposeResources(env_31); } })(), _a); C2 = class C2 extends C1 { constructor() { - const env_29 = { stack: [], error: void 0, hasError: false }; + const env_32 = { stack: [], error: void 0, hasError: false }; try { - const d16 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); + const d16 = __addDisposableResource(env_32, { [Symbol.dispose]() { } }, false); super(); } - catch (e_29) { - env_29.error = e_29; - env_29.hasError = true; + catch (e_32) { + env_32.error = e_32; + env_32.hasError = true; } finally { - __disposeResources(env_29); + __disposeResources(env_32); } } }; C3 = class C3 extends C1 { constructor() { - const env_30 = { stack: [], error: void 0, hasError: false }; + const env_33 = { stack: [], error: void 0, hasError: false }; try { - const d17 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); + const d17 = __addDisposableResource(env_33, { [Symbol.dispose]() { } }, false); super(); this.y = 1; } - catch (e_30) { - env_30.error = e_30; - env_30.hasError = true; + catch (e_33) { + env_33.error = e_33; + env_33.hasError = true; } finally { - __disposeResources(env_30); + __disposeResources(env_33); } } }; (function (N) { - const env_31 = { stack: [], error: void 0, hasError: false }; + const env_34 = { stack: [], error: void 0, hasError: false }; try { - const d18 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); + const d18 = __addDisposableResource(env_34, { [Symbol.dispose]() { } }, false); } - catch (e_31) { - env_31.error = e_31; - env_31.hasError = true; + catch (e_34) { + env_34.error = e_34; + env_34.hasError = true; } finally { - __disposeResources(env_31); + __disposeResources(env_34); } })(N || (N = {})); { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); + const d19 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - __disposeResources(env_3); + __disposeResources(env_2); } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); break; - case 1: - const d21 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + __disposeResources(env_3); + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + __disposeResources(env_4); + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + __disposeResources(env_5); + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - __disposeResources(env_1); - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + __disposeResources(env_6); + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + __disposeResources(env_7); + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - __disposeResources(env_4); - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - __disposeResources(env_5); - } - } - catch (_b) { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - __disposeResources(env_6); - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - __disposeResources(env_7); - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); + const d25 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); } catch (e_7) { env_8.error = e_7; @@ -581,10 +591,10 @@ try { __disposeResources(env_8); } } - else { + catch (_b) { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); + const d26 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); } catch (e_8) { env_9.error = e_8; @@ -594,11 +604,10 @@ try { __disposeResources(env_9); } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); - break; + const d27 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); } catch (e_9) { env_10.error = e_9; @@ -608,11 +617,10 @@ try { __disposeResources(env_10); } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); - break; + const d28 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); } catch (e_10) { env_11.error = e_10; @@ -621,12 +629,11 @@ try { finally { __disposeResources(env_11); } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); - break; + const d29 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); } catch (e_11) { env_12.error = e_11; @@ -636,10 +643,11 @@ try { __disposeResources(env_12); } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + const d30 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + break; } catch (e_12) { env_13.error = e_12; @@ -649,10 +657,11 @@ try { __disposeResources(env_13); } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + const d31 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + break; } catch (e_13) { env_14.error = e_13; @@ -661,13 +670,53 @@ try { finally { __disposeResources(env_14); } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + __disposeResources(env_15); + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + __disposeResources(env_16); + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + __disposeResources(env_17); + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - __disposeResources(env_2); + __disposeResources(env_1); } export {}; diff --git a/tests/baselines/reference/usingDeclarations.1(target=es2017).js b/tests/baselines/reference/usingDeclarations.1(target=es2017).js index 6759e29ae4561..3bc19b68e9120 100644 --- a/tests/baselines/reference/usingDeclarations.1(target=es2017).js +++ b/tests/baselines/reference/usingDeclarations.1(target=es2017).js @@ -94,61 +94,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; @@ -221,344 +232,343 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar }; var _a; function f() { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d2 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + const d2 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - __disposeResources(env_15); + __disposeResources(env_18); } } async function af() { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + const d3 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); await null; } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - __disposeResources(env_16); + __disposeResources(env_19); } } function* g() { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d4 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + const d4 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); yield; } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - __disposeResources(env_17); + __disposeResources(env_20); } } function ag() { return __asyncGenerator(this, arguments, function* ag_1() { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); + const d5 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); yield yield __await(void 0); yield __await(null); } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - __disposeResources(env_18); + __disposeResources(env_21); } }); } -var d1, a, C1, C2, C3, N, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1, C2, C3, N; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); + d1 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); a = () => { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); + const d6 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - __disposeResources(env_19); + __disposeResources(env_22); } }; C1 = (_a = class C1 { constructor() { this.a = () => { - const env_21 = { stack: [], error: void 0, hasError: false }; + const env_24 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); + const d7 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); } - catch (e_21) { - env_21.error = e_21; - env_21.hasError = true; + catch (e_24) { + env_24.error = e_24; + env_24.hasError = true; } finally { - __disposeResources(env_21); + __disposeResources(env_24); } }; - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d8 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); + const d8 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - __disposeResources(env_20); + __disposeResources(env_23); } } m() { - const env_22 = { stack: [], error: void 0, hasError: false }; + const env_25 = { stack: [], error: void 0, hasError: false }; try { - const d10 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); + const d10 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); } - catch (e_22) { - env_22.error = e_22; - env_22.hasError = true; + catch (e_25) { + env_25.error = e_25; + env_25.hasError = true; } finally { - __disposeResources(env_22); + __disposeResources(env_25); } } get x() { - const env_23 = { stack: [], error: void 0, hasError: false }; + const env_26 = { stack: [], error: void 0, hasError: false }; try { - const d11 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); + const d11 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); return 0; } - catch (e_23) { - env_23.error = e_23; - env_23.hasError = true; + catch (e_26) { + env_26.error = e_26; + env_26.hasError = true; } finally { - __disposeResources(env_23); + __disposeResources(env_26); } } set x(v) { - const env_24 = { stack: [], error: void 0, hasError: false }; + const env_27 = { stack: [], error: void 0, hasError: false }; try { - const d12 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); + const d12 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); } - catch (e_24) { - env_24.error = e_24; - env_24.hasError = true; + catch (e_27) { + env_27.error = e_27; + env_27.hasError = true; } finally { - __disposeResources(env_24); + __disposeResources(env_27); } } async am() { - const env_25 = { stack: [], error: void 0, hasError: false }; + const env_28 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); + const d13 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); await null; } - catch (e_25) { - env_25.error = e_25; - env_25.hasError = true; + catch (e_28) { + env_28.error = e_28; + env_28.hasError = true; } finally { - __disposeResources(env_25); + __disposeResources(env_28); } } *g() { - const env_26 = { stack: [], error: void 0, hasError: false }; + const env_29 = { stack: [], error: void 0, hasError: false }; try { - const d14 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); + const d14 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); yield; } - catch (e_26) { - env_26.error = e_26; - env_26.hasError = true; + catch (e_29) { + env_29.error = e_29; + env_29.hasError = true; } finally { - __disposeResources(env_26); + __disposeResources(env_29); } } ag() { return __asyncGenerator(this, arguments, function* ag_2() { - const env_27 = { stack: [], error: void 0, hasError: false }; + const env_30 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); + const d15 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); yield yield __await(void 0); yield __await(null); } - catch (e_27) { - env_27.error = e_27; - env_27.hasError = true; + catch (e_30) { + env_30.error = e_30; + env_30.hasError = true; } finally { - __disposeResources(env_27); + __disposeResources(env_30); } }); } }, (() => { - const env_28 = { stack: [], error: void 0, hasError: false }; + const env_31 = { stack: [], error: void 0, hasError: false }; try { - const d9 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); + const d9 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); } - catch (e_28) { - env_28.error = e_28; - env_28.hasError = true; + catch (e_31) { + env_31.error = e_31; + env_31.hasError = true; } finally { - __disposeResources(env_28); + __disposeResources(env_31); } })(), _a); C2 = class C2 extends C1 { constructor() { - const env_29 = { stack: [], error: void 0, hasError: false }; + const env_32 = { stack: [], error: void 0, hasError: false }; try { - const d16 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); + const d16 = __addDisposableResource(env_32, { [Symbol.dispose]() { } }, false); super(); } - catch (e_29) { - env_29.error = e_29; - env_29.hasError = true; + catch (e_32) { + env_32.error = e_32; + env_32.hasError = true; } finally { - __disposeResources(env_29); + __disposeResources(env_32); } } }; C3 = class C3 extends C1 { constructor() { - const env_30 = { stack: [], error: void 0, hasError: false }; + const env_33 = { stack: [], error: void 0, hasError: false }; try { - const d17 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); + const d17 = __addDisposableResource(env_33, { [Symbol.dispose]() { } }, false); super(); this.y = 1; } - catch (e_30) { - env_30.error = e_30; - env_30.hasError = true; + catch (e_33) { + env_33.error = e_33; + env_33.hasError = true; } finally { - __disposeResources(env_30); + __disposeResources(env_33); } } }; (function (N) { - const env_31 = { stack: [], error: void 0, hasError: false }; + const env_34 = { stack: [], error: void 0, hasError: false }; try { - const d18 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); + const d18 = __addDisposableResource(env_34, { [Symbol.dispose]() { } }, false); } - catch (e_31) { - env_31.error = e_31; - env_31.hasError = true; + catch (e_34) { + env_34.error = e_34; + env_34.hasError = true; } finally { - __disposeResources(env_31); + __disposeResources(env_34); } })(N || (N = {})); { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); + const d19 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - __disposeResources(env_3); + __disposeResources(env_2); } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); break; - case 1: - const d21 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + __disposeResources(env_3); + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + __disposeResources(env_4); + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + __disposeResources(env_5); + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - __disposeResources(env_1); - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + __disposeResources(env_6); + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + __disposeResources(env_7); + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - __disposeResources(env_4); - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - __disposeResources(env_5); - } - } - catch (_b) { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - __disposeResources(env_6); - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - __disposeResources(env_7); - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); + const d25 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); } catch (e_7) { env_8.error = e_7; @@ -568,10 +578,10 @@ try { __disposeResources(env_8); } } - else { + catch (_b) { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); + const d26 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); } catch (e_8) { env_9.error = e_8; @@ -581,11 +591,10 @@ try { __disposeResources(env_9); } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); - break; + const d27 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); } catch (e_9) { env_10.error = e_9; @@ -595,11 +604,10 @@ try { __disposeResources(env_10); } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); - break; + const d28 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); } catch (e_10) { env_11.error = e_10; @@ -608,12 +616,11 @@ try { finally { __disposeResources(env_11); } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); - break; + const d29 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); } catch (e_11) { env_12.error = e_11; @@ -623,10 +630,11 @@ try { __disposeResources(env_12); } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + const d30 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + break; } catch (e_12) { env_13.error = e_12; @@ -636,10 +644,11 @@ try { __disposeResources(env_13); } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + const d31 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + break; } catch (e_13) { env_14.error = e_13; @@ -648,13 +657,53 @@ try { finally { __disposeResources(env_14); } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + __disposeResources(env_15); + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + __disposeResources(env_16); + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + __disposeResources(env_17); + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - __disposeResources(env_2); + __disposeResources(env_1); } export {}; diff --git a/tests/baselines/reference/usingDeclarations.1(target=es2022).js b/tests/baselines/reference/usingDeclarations.1(target=es2022).js index 9b121b2c5cd92..6d265afe957b9 100644 --- a/tests/baselines/reference/usingDeclarations.1(target=es2022).js +++ b/tests/baselines/reference/usingDeclarations.1(target=es2022).js @@ -94,61 +94,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; @@ -207,339 +218,338 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }); function f() { - const env_15 = { stack: [], error: void 0, hasError: false }; + const env_18 = { stack: [], error: void 0, hasError: false }; try { - const d2 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + const d2 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - __disposeResources(env_15); + __disposeResources(env_18); } } async function af() { - const env_16 = { stack: [], error: void 0, hasError: false }; + const env_19 = { stack: [], error: void 0, hasError: false }; try { - const d3 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + const d3 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); await null; } - catch (e_16) { - env_16.error = e_16; - env_16.hasError = true; + catch (e_19) { + env_19.error = e_19; + env_19.hasError = true; } finally { - __disposeResources(env_16); + __disposeResources(env_19); } } function* g() { - const env_17 = { stack: [], error: void 0, hasError: false }; + const env_20 = { stack: [], error: void 0, hasError: false }; try { - const d4 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + const d4 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); yield; } - catch (e_17) { - env_17.error = e_17; - env_17.hasError = true; + catch (e_20) { + env_20.error = e_20; + env_20.hasError = true; } finally { - __disposeResources(env_17); + __disposeResources(env_20); } } async function* ag() { - const env_18 = { stack: [], error: void 0, hasError: false }; + const env_21 = { stack: [], error: void 0, hasError: false }; try { - const d5 = __addDisposableResource(env_18, { [Symbol.dispose]() { } }, false); + const d5 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); yield; await null; } - catch (e_18) { - env_18.error = e_18; - env_18.hasError = true; + catch (e_21) { + env_21.error = e_21; + env_21.hasError = true; } finally { - __disposeResources(env_18); + __disposeResources(env_21); } } -var d1, a, C1, C2, C3, N, env_1; -const env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1, C2, C3, N; +const env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); + d1 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); a = () => { - const env_19 = { stack: [], error: void 0, hasError: false }; + const env_22 = { stack: [], error: void 0, hasError: false }; try { - const d6 = __addDisposableResource(env_19, { [Symbol.dispose]() { } }, false); + const d6 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - __disposeResources(env_19); + __disposeResources(env_22); } }; C1 = class C1 { a = () => { - const env_20 = { stack: [], error: void 0, hasError: false }; + const env_23 = { stack: [], error: void 0, hasError: false }; try { - const d7 = __addDisposableResource(env_20, { [Symbol.dispose]() { } }, false); + const d7 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - __disposeResources(env_20); + __disposeResources(env_23); } }; constructor() { - const env_21 = { stack: [], error: void 0, hasError: false }; + const env_24 = { stack: [], error: void 0, hasError: false }; try { - const d8 = __addDisposableResource(env_21, { [Symbol.dispose]() { } }, false); + const d8 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); } - catch (e_21) { - env_21.error = e_21; - env_21.hasError = true; + catch (e_24) { + env_24.error = e_24; + env_24.hasError = true; } finally { - __disposeResources(env_21); + __disposeResources(env_24); } } static { - const env_22 = { stack: [], error: void 0, hasError: false }; + const env_25 = { stack: [], error: void 0, hasError: false }; try { - const d9 = __addDisposableResource(env_22, { [Symbol.dispose]() { } }, false); + const d9 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); } - catch (e_22) { - env_22.error = e_22; - env_22.hasError = true; + catch (e_25) { + env_25.error = e_25; + env_25.hasError = true; } finally { - __disposeResources(env_22); + __disposeResources(env_25); } } m() { - const env_23 = { stack: [], error: void 0, hasError: false }; + const env_26 = { stack: [], error: void 0, hasError: false }; try { - const d10 = __addDisposableResource(env_23, { [Symbol.dispose]() { } }, false); + const d10 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); } - catch (e_23) { - env_23.error = e_23; - env_23.hasError = true; + catch (e_26) { + env_26.error = e_26; + env_26.hasError = true; } finally { - __disposeResources(env_23); + __disposeResources(env_26); } } get x() { - const env_24 = { stack: [], error: void 0, hasError: false }; + const env_27 = { stack: [], error: void 0, hasError: false }; try { - const d11 = __addDisposableResource(env_24, { [Symbol.dispose]() { } }, false); + const d11 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); return 0; } - catch (e_24) { - env_24.error = e_24; - env_24.hasError = true; + catch (e_27) { + env_27.error = e_27; + env_27.hasError = true; } finally { - __disposeResources(env_24); + __disposeResources(env_27); } } set x(v) { - const env_25 = { stack: [], error: void 0, hasError: false }; + const env_28 = { stack: [], error: void 0, hasError: false }; try { - const d12 = __addDisposableResource(env_25, { [Symbol.dispose]() { } }, false); + const d12 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); } - catch (e_25) { - env_25.error = e_25; - env_25.hasError = true; + catch (e_28) { + env_28.error = e_28; + env_28.hasError = true; } finally { - __disposeResources(env_25); + __disposeResources(env_28); } } async am() { - const env_26 = { stack: [], error: void 0, hasError: false }; + const env_29 = { stack: [], error: void 0, hasError: false }; try { - const d13 = __addDisposableResource(env_26, { [Symbol.dispose]() { } }, false); + const d13 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); await null; } - catch (e_26) { - env_26.error = e_26; - env_26.hasError = true; + catch (e_29) { + env_29.error = e_29; + env_29.hasError = true; } finally { - __disposeResources(env_26); + __disposeResources(env_29); } } *g() { - const env_27 = { stack: [], error: void 0, hasError: false }; + const env_30 = { stack: [], error: void 0, hasError: false }; try { - const d14 = __addDisposableResource(env_27, { [Symbol.dispose]() { } }, false); + const d14 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); yield; } - catch (e_27) { - env_27.error = e_27; - env_27.hasError = true; + catch (e_30) { + env_30.error = e_30; + env_30.hasError = true; } finally { - __disposeResources(env_27); + __disposeResources(env_30); } } async *ag() { - const env_28 = { stack: [], error: void 0, hasError: false }; + const env_31 = { stack: [], error: void 0, hasError: false }; try { - const d15 = __addDisposableResource(env_28, { [Symbol.dispose]() { } }, false); + const d15 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); yield; await null; } - catch (e_28) { - env_28.error = e_28; - env_28.hasError = true; + catch (e_31) { + env_31.error = e_31; + env_31.hasError = true; } finally { - __disposeResources(env_28); + __disposeResources(env_31); } } }; C2 = class C2 extends C1 { constructor() { - const env_29 = { stack: [], error: void 0, hasError: false }; + const env_32 = { stack: [], error: void 0, hasError: false }; try { - const d16 = __addDisposableResource(env_29, { [Symbol.dispose]() { } }, false); + const d16 = __addDisposableResource(env_32, { [Symbol.dispose]() { } }, false); super(); } - catch (e_29) { - env_29.error = e_29; - env_29.hasError = true; + catch (e_32) { + env_32.error = e_32; + env_32.hasError = true; } finally { - __disposeResources(env_29); + __disposeResources(env_32); } } }; C3 = class C3 extends C1 { y = 1; constructor() { - const env_30 = { stack: [], error: void 0, hasError: false }; + const env_33 = { stack: [], error: void 0, hasError: false }; try { - const d17 = __addDisposableResource(env_30, { [Symbol.dispose]() { } }, false); + const d17 = __addDisposableResource(env_33, { [Symbol.dispose]() { } }, false); super(); } - catch (e_30) { - env_30.error = e_30; - env_30.hasError = true; + catch (e_33) { + env_33.error = e_33; + env_33.hasError = true; } finally { - __disposeResources(env_30); + __disposeResources(env_33); } } }; (function (N) { - const env_31 = { stack: [], error: void 0, hasError: false }; + const env_34 = { stack: [], error: void 0, hasError: false }; try { - const d18 = __addDisposableResource(env_31, { [Symbol.dispose]() { } }, false); + const d18 = __addDisposableResource(env_34, { [Symbol.dispose]() { } }, false); } - catch (e_31) { - env_31.error = e_31; - env_31.hasError = true; + catch (e_34) { + env_34.error = e_34; + env_34.hasError = true; } finally { - __disposeResources(env_31); + __disposeResources(env_34); } })(N || (N = {})); { - const env_3 = { stack: [], error: void 0, hasError: false }; + const env_2 = { stack: [], error: void 0, hasError: false }; try { - const d19 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); + const d19 = __addDisposableResource(env_2, { [Symbol.dispose]() { } }, false); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - __disposeResources(env_3); + __disposeResources(env_2); } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - const d20 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + switch (Math.random()) { + case 0: { + const env_3 = { stack: [], error: void 0, hasError: false }; + try { + const d20 = __addDisposableResource(env_3, { [Symbol.dispose]() { } }, false); break; - case 1: - const d21 = __addDisposableResource(env_1, { [Symbol.dispose]() { } }, false); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + __disposeResources(env_3); + } + } + case 1: { + const env_4 = { stack: [], error: void 0, hasError: false }; + try { + const d21 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + __disposeResources(env_4); + } + } + default: { + const env_5 = { stack: [], error: void 0, hasError: false }; + try { + const d22 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + __disposeResources(env_5); + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - __disposeResources(env_1); - } - if (true) { - const env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - const d22 = __addDisposableResource(env_4, { [Symbol.dispose]() { } }, false); + if (true) + switch (0) { + case 0: { + const env_6 = { stack: [], error: void 0, hasError: false }; + try { + const d23 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + __disposeResources(env_6); + } + } + default: { + const env_7 = { stack: [], error: void 0, hasError: false }; + try { + const d24 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + __disposeResources(env_7); + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - __disposeResources(env_4); - } - } try { - const env_5 = { stack: [], error: void 0, hasError: false }; - try { - const d23 = __addDisposableResource(env_5, { [Symbol.dispose]() { } }, false); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - __disposeResources(env_5); - } - } - catch { - const env_6 = { stack: [], error: void 0, hasError: false }; - try { - const d24 = __addDisposableResource(env_6, { [Symbol.dispose]() { } }, false); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - __disposeResources(env_6); - } - } - finally { - const env_7 = { stack: [], error: void 0, hasError: false }; - try { - const d25 = __addDisposableResource(env_7, { [Symbol.dispose]() { } }, false); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - __disposeResources(env_7); - } - } - if (true) { const env_8 = { stack: [], error: void 0, hasError: false }; try { - const d26 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); + const d25 = __addDisposableResource(env_8, { [Symbol.dispose]() { } }, false); } catch (e_7) { env_8.error = e_7; @@ -549,10 +559,10 @@ try { __disposeResources(env_8); } } - else { + catch { const env_9 = { stack: [], error: void 0, hasError: false }; try { - const d27 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); + const d26 = __addDisposableResource(env_9, { [Symbol.dispose]() { } }, false); } catch (e_8) { env_9.error = e_8; @@ -562,11 +572,10 @@ try { __disposeResources(env_9); } } - while (true) { + finally { const env_10 = { stack: [], error: void 0, hasError: false }; try { - const d28 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); - break; + const d27 = __addDisposableResource(env_10, { [Symbol.dispose]() { } }, false); } catch (e_9) { env_10.error = e_9; @@ -576,11 +585,10 @@ try { __disposeResources(env_10); } } - do { + if (true) { const env_11 = { stack: [], error: void 0, hasError: false }; try { - const d29 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); - break; + const d28 = __addDisposableResource(env_11, { [Symbol.dispose]() { } }, false); } catch (e_10) { env_11.error = e_10; @@ -589,12 +597,11 @@ try { finally { __disposeResources(env_11); } - } while (true); - for (;;) { + } + else { const env_12 = { stack: [], error: void 0, hasError: false }; try { - const d30 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); - break; + const d29 = __addDisposableResource(env_12, { [Symbol.dispose]() { } }, false); } catch (e_11) { env_12.error = e_11; @@ -604,10 +611,11 @@ try { __disposeResources(env_12); } } - for (const x in {}) { + while (true) { const env_13 = { stack: [], error: void 0, hasError: false }; try { - const d31 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + const d30 = __addDisposableResource(env_13, { [Symbol.dispose]() { } }, false); + break; } catch (e_12) { env_13.error = e_12; @@ -617,10 +625,11 @@ try { __disposeResources(env_13); } } - for (const x of []) { + do { const env_14 = { stack: [], error: void 0, hasError: false }; try { - const d32 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + const d31 = __addDisposableResource(env_14, { [Symbol.dispose]() { } }, false); + break; } catch (e_13) { env_14.error = e_13; @@ -629,13 +638,53 @@ try { finally { __disposeResources(env_14); } + } while (true); + for (;;) { + const env_15 = { stack: [], error: void 0, hasError: false }; + try { + const d32 = __addDisposableResource(env_15, { [Symbol.dispose]() { } }, false); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + __disposeResources(env_15); + } + } + for (const x in {}) { + const env_16 = { stack: [], error: void 0, hasError: false }; + try { + const d33 = __addDisposableResource(env_16, { [Symbol.dispose]() { } }, false); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + __disposeResources(env_16); + } + } + for (const x of []) { + const env_17 = { stack: [], error: void 0, hasError: false }; + try { + const d34 = __addDisposableResource(env_17, { [Symbol.dispose]() { } }, false); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + __disposeResources(env_17); + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - __disposeResources(env_2); + __disposeResources(env_1); } export {}; diff --git a/tests/baselines/reference/usingDeclarations.1(target=es5).js b/tests/baselines/reference/usingDeclarations.1(target=es5).js index d9a8c2e561e93..239c9b584e83a 100644 --- a/tests/baselines/reference/usingDeclarations.1(target=es5).js +++ b/tests/baselines/reference/usingDeclarations.1(target=es5).js @@ -94,61 +94,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; @@ -270,45 +281,45 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q; -var _r; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s; +var _t; function f() { var _a; - var env_15 = { stack: [], error: void 0, hasError: false }; + var env_18 = { stack: [], error: void 0, hasError: false }; try { - var d2 = __addDisposableResource(env_15, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d2 = __addDisposableResource(env_18, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_15) { - env_15.error = e_15; - env_15.hasError = true; + catch (e_18) { + env_18.error = e_18; + env_18.hasError = true; } finally { - __disposeResources(env_15); + __disposeResources(env_18); } } function af() { return __awaiter(this, void 0, void 0, function () { - var env_16, d3, e_16; + var env_19, d3, e_19; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_16 = { stack: [], error: void 0, hasError: false }; + env_19 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - d3 = __addDisposableResource(env_16, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d3 = __addDisposableResource(env_19, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/, null]; case 2: _b.sent(); return [3 /*break*/, 5]; case 3: - e_16 = _b.sent(); - env_16.error = e_16; - env_16.hasError = true; + e_19 = _b.sent(); + env_19.error = e_19; + env_19.hasError = true; return [3 /*break*/, 5]; case 4: - __disposeResources(env_16); + __disposeResources(env_19); return [7 /*endfinally*/]; case 5: return [2 /*return*/]; } @@ -316,27 +327,27 @@ function af() { }); } function g() { - var env_17, d4, e_17; + var env_20, d4, e_20; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_17 = { stack: [], error: void 0, hasError: false }; + env_20 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - d4 = __addDisposableResource(env_17, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d4 = __addDisposableResource(env_20, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/]; case 2: _b.sent(); return [3 /*break*/, 5]; case 3: - e_17 = _b.sent(); - env_17.error = e_17; - env_17.hasError = true; + e_20 = _b.sent(); + env_20.error = e_20; + env_20.hasError = true; return [3 /*break*/, 5]; case 4: - __disposeResources(env_17); + __disposeResources(env_20); return [7 /*endfinally*/]; case 5: return [2 /*return*/]; } @@ -344,16 +355,16 @@ function g() { } function ag() { return __asyncGenerator(this, arguments, function ag_1() { - var env_18, d5, e_18; + var env_21, d5, e_21; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_18 = { stack: [], error: void 0, hasError: false }; + env_21 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 5, 6, 7]); - d5 = __addDisposableResource(env_18, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d5 = __addDisposableResource(env_21, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/, __await(void 0)]; case 2: return [4 /*yield*/, _b.sent()]; case 3: @@ -363,107 +374,107 @@ function ag() { _b.sent(); return [3 /*break*/, 7]; case 5: - e_18 = _b.sent(); - env_18.error = e_18; - env_18.hasError = true; + e_21 = _b.sent(); + env_21.error = e_21; + env_21.hasError = true; return [3 /*break*/, 7]; case 6: - __disposeResources(env_18); + __disposeResources(env_21); return [7 /*endfinally*/]; case 7: return [2 /*return*/]; } }); }); } -var d1, a, C1, C2, C3, N, env_1; -var env_2 = { stack: [], error: void 0, hasError: false }; +var d1, a, C1, C2, C3, N; +var env_1 = { stack: [], error: void 0, hasError: false }; try { - d1 = __addDisposableResource(env_2, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d1 = __addDisposableResource(env_1, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); a = function () { var _a; - var env_19 = { stack: [], error: void 0, hasError: false }; + var env_22 = { stack: [], error: void 0, hasError: false }; try { - var d6 = __addDisposableResource(env_19, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d6 = __addDisposableResource(env_22, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_19) { - env_19.error = e_19; - env_19.hasError = true; + catch (e_22) { + env_22.error = e_22; + env_22.hasError = true; } finally { - __disposeResources(env_19); + __disposeResources(env_22); } }; - C1 = (_r = /** @class */ (function () { + C1 = (_t = /** @class */ (function () { function C1() { var _a; this.a = function () { var _a; - var env_21 = { stack: [], error: void 0, hasError: false }; + var env_24 = { stack: [], error: void 0, hasError: false }; try { - var d7 = __addDisposableResource(env_21, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d7 = __addDisposableResource(env_24, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_21) { - env_21.error = e_21; - env_21.hasError = true; + catch (e_24) { + env_24.error = e_24; + env_24.hasError = true; } finally { - __disposeResources(env_21); + __disposeResources(env_24); } }; - var env_20 = { stack: [], error: void 0, hasError: false }; + var env_23 = { stack: [], error: void 0, hasError: false }; try { - var d8 = __addDisposableResource(env_20, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d8 = __addDisposableResource(env_23, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_20) { - env_20.error = e_20; - env_20.hasError = true; + catch (e_23) { + env_23.error = e_23; + env_23.hasError = true; } finally { - __disposeResources(env_20); + __disposeResources(env_23); } } C1.prototype.m = function () { var _a; - var env_22 = { stack: [], error: void 0, hasError: false }; + var env_25 = { stack: [], error: void 0, hasError: false }; try { - var d10 = __addDisposableResource(env_22, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d10 = __addDisposableResource(env_25, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_22) { - env_22.error = e_22; - env_22.hasError = true; + catch (e_25) { + env_25.error = e_25; + env_25.hasError = true; } finally { - __disposeResources(env_22); + __disposeResources(env_25); } }; Object.defineProperty(C1.prototype, "x", { get: function () { var _a; - var env_23 = { stack: [], error: void 0, hasError: false }; + var env_26 = { stack: [], error: void 0, hasError: false }; try { - var d11 = __addDisposableResource(env_23, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d11 = __addDisposableResource(env_26, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return 0; } - catch (e_23) { - env_23.error = e_23; - env_23.hasError = true; + catch (e_26) { + env_26.error = e_26; + env_26.hasError = true; } finally { - __disposeResources(env_23); + __disposeResources(env_26); } }, set: function (v) { var _a; - var env_24 = { stack: [], error: void 0, hasError: false }; + var env_27 = { stack: [], error: void 0, hasError: false }; try { - var d12 = __addDisposableResource(env_24, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d12 = __addDisposableResource(env_27, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_24) { - env_24.error = e_24; - env_24.hasError = true; + catch (e_27) { + env_27.error = e_27; + env_27.hasError = true; } finally { - __disposeResources(env_24); + __disposeResources(env_27); } }, enumerable: false, @@ -471,27 +482,27 @@ try { }); C1.prototype.am = function () { return __awaiter(this, void 0, void 0, function () { - var env_25, d13, e_25; + var env_28, d13, e_28; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_25 = { stack: [], error: void 0, hasError: false }; + env_28 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - d13 = __addDisposableResource(env_25, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d13 = __addDisposableResource(env_28, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/, null]; case 2: _b.sent(); return [3 /*break*/, 5]; case 3: - e_25 = _b.sent(); - env_25.error = e_25; - env_25.hasError = true; + e_28 = _b.sent(); + env_28.error = e_28; + env_28.hasError = true; return [3 /*break*/, 5]; case 4: - __disposeResources(env_25); + __disposeResources(env_28); return [7 /*endfinally*/]; case 5: return [2 /*return*/]; } @@ -499,27 +510,27 @@ try { }); }; C1.prototype.g = function () { - var env_26, d14, e_26; + var env_29, d14, e_29; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_26 = { stack: [], error: void 0, hasError: false }; + env_29 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - d14 = __addDisposableResource(env_26, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d14 = __addDisposableResource(env_29, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/]; case 2: _b.sent(); return [3 /*break*/, 5]; case 3: - e_26 = _b.sent(); - env_26.error = e_26; - env_26.hasError = true; + e_29 = _b.sent(); + env_29.error = e_29; + env_29.hasError = true; return [3 /*break*/, 5]; case 4: - __disposeResources(env_26); + __disposeResources(env_29); return [7 /*endfinally*/]; case 5: return [2 /*return*/]; } @@ -527,16 +538,16 @@ try { }; C1.prototype.ag = function () { return __asyncGenerator(this, arguments, function ag_2() { - var env_27, d15, e_27; + var env_30, d15, e_30; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - env_27 = { stack: [], error: void 0, hasError: false }; + env_30 = { stack: [], error: void 0, hasError: false }; _b.label = 1; case 1: _b.trys.push([1, 5, 6, 7]); - d15 = __addDisposableResource(env_27, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + d15 = __addDisposableResource(env_30, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); return [4 /*yield*/, __await(void 0)]; case 2: return [4 /*yield*/, _b.sent()]; case 3: @@ -546,12 +557,12 @@ try { _b.sent(); return [3 /*break*/, 7]; case 5: - e_27 = _b.sent(); - env_27.error = e_27; - env_27.hasError = true; + e_30 = _b.sent(); + env_30.error = e_30; + env_30.hasError = true; return [3 /*break*/, 7]; case 6: - __disposeResources(env_27); + __disposeResources(env_30); return [7 /*endfinally*/]; case 7: return [2 /*return*/]; } @@ -562,35 +573,35 @@ try { }()), (function () { var _a; - var env_28 = { stack: [], error: void 0, hasError: false }; + var env_31 = { stack: [], error: void 0, hasError: false }; try { - var d9 = __addDisposableResource(env_28, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d9 = __addDisposableResource(env_31, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_28) { - env_28.error = e_28; - env_28.hasError = true; + catch (e_31) { + env_31.error = e_31; + env_31.hasError = true; } finally { - __disposeResources(env_28); + __disposeResources(env_31); } })(), - _r); + _t); C2 = /** @class */ (function (_super) { __extends(C2, _super); function C2() { var _a; var _this = this; - var env_29 = { stack: [], error: void 0, hasError: false }; + var env_32 = { stack: [], error: void 0, hasError: false }; try { - var d16 = __addDisposableResource(env_29, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d16 = __addDisposableResource(env_32, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); _this = _super.call(this) || this; } - catch (e_29) { - env_29.error = e_29; - env_29.hasError = true; + catch (e_32) { + env_32.error = e_32; + env_32.hasError = true; } finally { - __disposeResources(env_29); + __disposeResources(env_32); } return _this; } @@ -601,18 +612,18 @@ try { function C3() { var _a; var _this = this; - var env_30 = { stack: [], error: void 0, hasError: false }; + var env_33 = { stack: [], error: void 0, hasError: false }; try { - var d17 = __addDisposableResource(env_30, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d17 = __addDisposableResource(env_33, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); _this = _super.call(this) || this; _this.y = 1; } - catch (e_30) { - env_30.error = e_30; - env_30.hasError = true; + catch (e_33) { + env_33.error = e_33; + env_33.hasError = true; } finally { - __disposeResources(env_30); + __disposeResources(env_33); } return _this; } @@ -620,109 +631,108 @@ try { }(C1)); (function (N) { var _a; - var env_31 = { stack: [], error: void 0, hasError: false }; + var env_34 = { stack: [], error: void 0, hasError: false }; try { - var d18 = __addDisposableResource(env_31, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); + var d18 = __addDisposableResource(env_34, (_a = {}, _a[Symbol.dispose] = function () { }, _a), false); } - catch (e_31) { - env_31.error = e_31; - env_31.hasError = true; + catch (e_34) { + env_34.error = e_34; + env_34.hasError = true; } finally { - __disposeResources(env_31); + __disposeResources(env_34); } })(N || (N = {})); { - var env_3 = { stack: [], error: void 0, hasError: false }; + var env_2 = { stack: [], error: void 0, hasError: false }; try { - var d19 = __addDisposableResource(env_3, (_b = {}, _b[Symbol.dispose] = function () { }, _b), false); + var d19 = __addDisposableResource(env_2, (_b = {}, _b[Symbol.dispose] = function () { }, _b), false); } catch (e_1) { - env_3.error = e_1; - env_3.hasError = true; + env_2.error = e_1; + env_2.hasError = true; } finally { - __disposeResources(env_3); + __disposeResources(env_2); } } - env_1 = { stack: [], error: void 0, hasError: false }; - try { - switch (Math.random()) { - case 0: - var d20 = __addDisposableResource(env_1, (_c = {}, _c[Symbol.dispose] = function () { }, _c), false); + switch (Math.random()) { + case 0: { + var env_3 = { stack: [], error: void 0, hasError: false }; + try { + var d20 = __addDisposableResource(env_3, (_c = {}, _c[Symbol.dispose] = function () { }, _c), false); break; - case 1: - var d21 = __addDisposableResource(env_1, (_d = {}, _d[Symbol.dispose] = function () { }, _d), false); + } + catch (e_2) { + env_3.error = e_2; + env_3.hasError = true; + } + finally { + __disposeResources(env_3); + } + } + case 1: { + var env_4 = { stack: [], error: void 0, hasError: false }; + try { + var d21 = __addDisposableResource(env_4, (_d = {}, _d[Symbol.dispose] = function () { }, _d), false); break; + } + catch (e_3) { + env_4.error = e_3; + env_4.hasError = true; + } + finally { + __disposeResources(env_4); + } + } + default: { + var env_5 = { stack: [], error: void 0, hasError: false }; + try { + var d22 = __addDisposableResource(env_5, (_e = {}, _e[Symbol.dispose] = function () { }, _e), false); + } + catch (e_4) { + env_5.error = e_4; + env_5.hasError = true; + } + finally { + __disposeResources(env_5); + } } } - catch (e_2) { - env_1.error = e_2; - env_1.hasError = true; - } - finally { - __disposeResources(env_1); - } - if (true) { - var env_4 = { stack: [], error: void 0, hasError: false }; - try { - switch (0) { - case 0: - var d22 = __addDisposableResource(env_4, (_e = {}, _e[Symbol.dispose] = function () { }, _e), false); + if (true) + switch (0) { + case 0: { + var env_6 = { stack: [], error: void 0, hasError: false }; + try { + var d23 = __addDisposableResource(env_6, (_f = {}, _f[Symbol.dispose] = function () { }, _f), false); break; + } + catch (e_5) { + env_6.error = e_5; + env_6.hasError = true; + } + finally { + __disposeResources(env_6); + } + } + default: { + var env_7 = { stack: [], error: void 0, hasError: false }; + try { + var d24 = __addDisposableResource(env_7, (_g = {}, _g[Symbol.dispose] = function () { }, _g), false); + } + catch (e_6) { + env_7.error = e_6; + env_7.hasError = true; + } + finally { + __disposeResources(env_7); + } } } - catch (e_3) { - env_4.error = e_3; - env_4.hasError = true; - } - finally { - __disposeResources(env_4); - } - } try { - var env_5 = { stack: [], error: void 0, hasError: false }; - try { - var d23 = __addDisposableResource(env_5, (_f = {}, _f[Symbol.dispose] = function () { }, _f), false); - } - catch (e_4) { - env_5.error = e_4; - env_5.hasError = true; - } - finally { - __disposeResources(env_5); - } - } - catch (_s) { - var env_6 = { stack: [], error: void 0, hasError: false }; - try { - var d24 = __addDisposableResource(env_6, (_g = {}, _g[Symbol.dispose] = function () { }, _g), false); - } - catch (e_5) { - env_6.error = e_5; - env_6.hasError = true; - } - finally { - __disposeResources(env_6); - } - } - finally { - var env_7 = { stack: [], error: void 0, hasError: false }; - try { - var d25 = __addDisposableResource(env_7, (_h = {}, _h[Symbol.dispose] = function () { }, _h), false); - } - catch (e_6) { - env_7.error = e_6; - env_7.hasError = true; - } - finally { - __disposeResources(env_7); - } - } - if (true) { var env_8 = { stack: [], error: void 0, hasError: false }; try { - var d26 = __addDisposableResource(env_8, (_j = {}, _j[Symbol.dispose] = function () { }, _j), false); + var d25 = __addDisposableResource(env_8, (_h = {}, _h[Symbol.dispose] = function () { }, _h), false); } catch (e_7) { env_8.error = e_7; @@ -732,10 +742,10 @@ try { __disposeResources(env_8); } } - else { + catch (_u) { var env_9 = { stack: [], error: void 0, hasError: false }; try { - var d27 = __addDisposableResource(env_9, (_k = {}, _k[Symbol.dispose] = function () { }, _k), false); + var d26 = __addDisposableResource(env_9, (_j = {}, _j[Symbol.dispose] = function () { }, _j), false); } catch (e_8) { env_9.error = e_8; @@ -745,11 +755,10 @@ try { __disposeResources(env_9); } } - while (true) { + finally { var env_10 = { stack: [], error: void 0, hasError: false }; try { - var d28 = __addDisposableResource(env_10, (_l = {}, _l[Symbol.dispose] = function () { }, _l), false); - break; + var d27 = __addDisposableResource(env_10, (_k = {}, _k[Symbol.dispose] = function () { }, _k), false); } catch (e_9) { env_10.error = e_9; @@ -759,11 +768,10 @@ try { __disposeResources(env_10); } } - do { + if (true) { var env_11 = { stack: [], error: void 0, hasError: false }; try { - var d29 = __addDisposableResource(env_11, (_m = {}, _m[Symbol.dispose] = function () { }, _m), false); - break; + var d28 = __addDisposableResource(env_11, (_l = {}, _l[Symbol.dispose] = function () { }, _l), false); } catch (e_10) { env_11.error = e_10; @@ -772,12 +780,11 @@ try { finally { __disposeResources(env_11); } - } while (true); - for (;;) { + } + else { var env_12 = { stack: [], error: void 0, hasError: false }; try { - var d30 = __addDisposableResource(env_12, (_o = {}, _o[Symbol.dispose] = function () { }, _o), false); - break; + var d29 = __addDisposableResource(env_12, (_m = {}, _m[Symbol.dispose] = function () { }, _m), false); } catch (e_11) { env_12.error = e_11; @@ -787,10 +794,11 @@ try { __disposeResources(env_12); } } - for (var x in {}) { + while (true) { var env_13 = { stack: [], error: void 0, hasError: false }; try { - var d31 = __addDisposableResource(env_13, (_p = {}, _p[Symbol.dispose] = function () { }, _p), false); + var d30 = __addDisposableResource(env_13, (_o = {}, _o[Symbol.dispose] = function () { }, _o), false); + break; } catch (e_12) { env_13.error = e_12; @@ -800,11 +808,11 @@ try { __disposeResources(env_13); } } - for (var _i = 0, _t = []; _i < _t.length; _i++) { - var x = _t[_i]; + do { var env_14 = { stack: [], error: void 0, hasError: false }; try { - var d32 = __addDisposableResource(env_14, (_q = {}, _q[Symbol.dispose] = function () { }, _q), false); + var d31 = __addDisposableResource(env_14, (_p = {}, _p[Symbol.dispose] = function () { }, _p), false); + break; } catch (e_13) { env_14.error = e_13; @@ -813,13 +821,54 @@ try { finally { __disposeResources(env_14); } + } while (true); + for (;;) { + var env_15 = { stack: [], error: void 0, hasError: false }; + try { + var d32 = __addDisposableResource(env_15, (_q = {}, _q[Symbol.dispose] = function () { }, _q), false); + break; + } + catch (e_14) { + env_15.error = e_14; + env_15.hasError = true; + } + finally { + __disposeResources(env_15); + } + } + for (var x in {}) { + var env_16 = { stack: [], error: void 0, hasError: false }; + try { + var d33 = __addDisposableResource(env_16, (_r = {}, _r[Symbol.dispose] = function () { }, _r), false); + } + catch (e_15) { + env_16.error = e_15; + env_16.hasError = true; + } + finally { + __disposeResources(env_16); + } + } + for (var _i = 0, _v = []; _i < _v.length; _i++) { + var x = _v[_i]; + var env_17 = { stack: [], error: void 0, hasError: false }; + try { + var d34 = __addDisposableResource(env_17, (_s = {}, _s[Symbol.dispose] = function () { }, _s), false); + } + catch (e_16) { + env_17.error = e_16; + env_17.hasError = true; + } + finally { + __disposeResources(env_17); + } } } -catch (e_14) { - env_2.error = e_14; - env_2.hasError = true; +catch (e_17) { + env_1.error = e_17; + env_1.hasError = true; } finally { - __disposeResources(env_2); + __disposeResources(env_1); } export {}; diff --git a/tests/baselines/reference/usingDeclarations.1(target=esnext).js b/tests/baselines/reference/usingDeclarations.1(target=esnext).js index 7f52b6f359409..bee041fdf249b 100644 --- a/tests/baselines/reference/usingDeclarations.1(target=esnext).js +++ b/tests/baselines/reference/usingDeclarations.1(target=esnext).js @@ -94,61 +94,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; @@ -229,50 +240,59 @@ var N; using d19 = { [Symbol.dispose]() { } }; } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() { } }; break; - case 1: + } + case 1: { using d21 = { [Symbol.dispose]() { } }; break; + } + default: { + using d22 = { [Symbol.dispose]() { } }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() { } }; + case 0: { + using d23 = { [Symbol.dispose]() { } }; break; + } + default: { + using d24 = { [Symbol.dispose]() { } }; + } } try { - using d23 = { [Symbol.dispose]() { } }; + using d25 = { [Symbol.dispose]() { } }; } catch { - using d24 = { [Symbol.dispose]() { } }; + using d26 = { [Symbol.dispose]() { } }; } finally { - using d25 = { [Symbol.dispose]() { } }; + using d27 = { [Symbol.dispose]() { } }; } if (true) { - using d26 = { [Symbol.dispose]() { } }; + using d28 = { [Symbol.dispose]() { } }; } else { - using d27 = { [Symbol.dispose]() { } }; + using d29 = { [Symbol.dispose]() { } }; } while (true) { - using d28 = { [Symbol.dispose]() { } }; + using d30 = { [Symbol.dispose]() { } }; break; } do { - using d29 = { [Symbol.dispose]() { } }; + using d31 = { [Symbol.dispose]() { } }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() { } }; + using d32 = { [Symbol.dispose]() { } }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() { } }; + using d33 = { [Symbol.dispose]() { } }; } for (const x of []) { - using d32 = { [Symbol.dispose]() { } }; + using d34 = { [Symbol.dispose]() { } }; } export {}; diff --git a/tests/baselines/reference/usingDeclarations.17.errors.txt b/tests/baselines/reference/usingDeclarations.17.errors.txt new file mode 100644 index 0000000000000..e32bffc3b1215 --- /dev/null +++ b/tests/baselines/reference/usingDeclarations.17.errors.txt @@ -0,0 +1,43 @@ +usingDeclarations.17.ts(3,9): error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +usingDeclarations.17.ts(7,9): error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +usingDeclarations.17.ts(11,9): error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +usingDeclarations.17.ts(17,13): error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. +usingDeclarations.17.ts(21,13): error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + + +==== usingDeclarations.17.ts (5 errors) ==== + switch (Math.random()) { + case 0: + using d20 = { [Symbol.dispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + case 1: + using d21 = { [Symbol.dispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + default: + using d22 = { [Symbol.dispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + } + + if (true) + switch (0) { + case 0: + using d23 = { [Symbol.dispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + break; + + default: + using d24 = { [Symbol.dispose]() {} }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1547: 'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block. + } + + export {}; + \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarations.17.js b/tests/baselines/reference/usingDeclarations.17.js new file mode 100644 index 0000000000000..b6ed81898f6fc --- /dev/null +++ b/tests/baselines/reference/usingDeclarations.17.js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.17.ts] //// + +//// [usingDeclarations.17.ts] +switch (Math.random()) { + case 0: + using d20 = { [Symbol.dispose]() {} }; + break; + + case 1: + using d21 = { [Symbol.dispose]() {} }; + break; + + default: + using d22 = { [Symbol.dispose]() {} }; +} + +if (true) + switch (0) { + case 0: + using d23 = { [Symbol.dispose]() {} }; + break; + + default: + using d24 = { [Symbol.dispose]() {} }; + } + +export {}; + + +//// [usingDeclarations.17.js] +switch (Math.random()) { + case 0: + using d20 = { [Symbol.dispose]() { } }; + break; + case 1: + using d21 = { [Symbol.dispose]() { } }; + break; + default: + using d22 = { [Symbol.dispose]() { } }; +} +if (true) + switch (0) { + case 0: + using d23 = { [Symbol.dispose]() { } }; + break; + default: + using d24 = { [Symbol.dispose]() { } }; + } +export {}; diff --git a/tests/baselines/reference/vueLikeDataAndPropsInference.types b/tests/baselines/reference/vueLikeDataAndPropsInference.types index f71eba5d8bf66..84cb8efb7b79c 100644 --- a/tests/baselines/reference/vueLikeDataAndPropsInference.types +++ b/tests/baselines/reference/vueLikeDataAndPropsInference.types @@ -72,8 +72,8 @@ test({ > : ^^^^ >test : { (fn: ThisTypedOptions): void; (fn: Options): void; } > : ^^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ->{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(this: Readonly<{ foo: string; }> & Instance): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^^ +>{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^^ props: { >props : { foo: string; } @@ -90,8 +90,8 @@ test({ }, data(): { bar: boolean } { ->data : (this: Readonly<{ foo: string; }> & Instance) => { bar: boolean; } -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>data : () => { bar: boolean; } +> : ^^^^^^ >bar : boolean > : ^^^^^^^ diff --git a/tests/baselines/reference/vueLikeDataAndPropsInference2.types b/tests/baselines/reference/vueLikeDataAndPropsInference2.types index 206646398de17..ffacfe540217f 100644 --- a/tests/baselines/reference/vueLikeDataAndPropsInference2.types +++ b/tests/baselines/reference/vueLikeDataAndPropsInference2.types @@ -73,8 +73,8 @@ test({ > : ^^^^ >test : { (fn: ThisTypedOptions): void; (fn: Options): void; } > : ^^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ->{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(this: Readonly<{ foo: string; }> & Instance): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^^ +>{ props: { foo: '' }, data(): { bar: boolean } { return { bar: true } }, watch: { foo(newVal: string, oldVal: string): void { this.bar = false } }} : { props: { foo: string; }; data(): { bar: boolean; }; watch: { foo(newVal: string, oldVal: string): void; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^^ props: { >props : { foo: string; } @@ -91,8 +91,8 @@ test({ }, data(): { bar: boolean } { ->data : (this: Readonly<{ foo: string; }> & Instance) => { bar: boolean; } -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>data : () => { bar: boolean; } +> : ^^^^^^ >bar : boolean > : ^^^^^^^ diff --git a/tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts b/tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts index fed9cc82e5ef5..3cb995ad8adfa 100644 --- a/tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts +++ b/tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts @@ -1,4 +1,4 @@ -module M +namespace M { class ClassA {} } diff --git a/tests/cases/compiler/circularModuleImports.ts b/tests/cases/compiler/circularModuleImports.ts index b251eab3335c3..af948e57f36a0 100644 --- a/tests/cases/compiler/circularModuleImports.ts +++ b/tests/cases/compiler/circularModuleImports.ts @@ -1,4 +1,4 @@ -module M +namespace M { diff --git a/tests/cases/compiler/cloduleTest1.ts b/tests/cases/compiler/cloduleTest1.ts index d5bc88b42de49..e844b5b843e36 100644 --- a/tests/cases/compiler/cloduleTest1.ts +++ b/tests/cases/compiler/cloduleTest1.ts @@ -2,7 +2,7 @@ interface $ { addClass(className: string): $; } - module $ { + namespace $ { export interface AjaxSettings { } export function ajax(options: AjaxSettings) { } diff --git a/tests/cases/compiler/cloduleWithRecursiveReference.ts b/tests/cases/compiler/cloduleWithRecursiveReference.ts index 47f94f8b1c052..0a01dc87abbba 100644 --- a/tests/cases/compiler/cloduleWithRecursiveReference.ts +++ b/tests/cases/compiler/cloduleWithRecursiveReference.ts @@ -1,4 +1,4 @@ -module M +namespace M { export class C { } export namespace C { diff --git a/tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts b/tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts index 1c08325b5702b..da77af3092aa8 100644 Binary files a/tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts and b/tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts differ diff --git a/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts new file mode 100644 index 0000000000000..30b76dd33f986 --- /dev/null +++ b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts @@ -0,0 +1,34 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +interface Effect { + _A: A; +} + +declare function effectGen(f: () => AEff): Effect; + +declare function effectFn>( + body: (...args: Args) => unknown, +): (...args: Args) => Effect; + +declare function layerEffect(tag: Tag, effect: Effect): unknown; + +interface Tag { + _Type: Type; +} + +declare const Foo: Tag<{ + fn: (a: string) => unknown; +}>; + +layerEffect( + Foo, + effectGen(function () { + return { + fn: effectFn(function (a) { + a; // string + }), + }; + }), +); diff --git a/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference2.ts b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference2.ts new file mode 100644 index 0000000000000..fb8eeb0a503e4 --- /dev/null +++ b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference2.ts @@ -0,0 +1,92 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +type Covariant = (_: never) => A; + +interface Effect { + readonly _A: Covariant; + readonly _E: Covariant; + readonly _R: Covariant; +} + +declare function effectGen, AEff>( + f: () => Generator +): Effect< + AEff, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? E + : never, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? R + : never +>; + +declare function effectFn< + Eff extends Effect, + AEff, + Args extends Array +>( + body: (...args: Args) => Generator +): ( + ...args: Args +) => Effect< + AEff, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? E + : never, + [Eff] extends [never] + ? never + : [Eff] extends [Effect] + ? R + : never +>; + +interface Tag { + readonly _op: "Tag"; + readonly Service: Value; + readonly Identifier: Id; +} + +interface TagClassShape { + readonly Type: Shape; + readonly Id: Id; +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; + readonly key: Id; +} + +declare function layerEffect( + tag: Tag, + effect: Effect +): unknown; + +declare function Tag( + id: Id +): () => TagClass; + +class Foo extends Tag("Foo")< + Foo, + { + fn: (a: string) => Effect; + } +>() {} + +layerEffect( + Foo, + effectGen(function* () { + return { + fn: effectFn(function* (a) { + a; // string + }), + }; + }) +); diff --git a/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference3.ts b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference3.ts new file mode 100644 index 0000000000000..8a0d653d5bbe8 --- /dev/null +++ b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference3.ts @@ -0,0 +1,76 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +type Covariant = (_: never) => A; + +interface Effect { + readonly _A: Covariant; + readonly _E: Covariant; + readonly _R: Covariant; +} + +declare function effectGen, AEff>( + f: () => Generator, +): Effect< + AEff, + [Eff] extends [Effect] ? E : never, + [Eff] extends [Effect] ? R : never +>; + +declare function effectFn< + Eff extends Effect, + AEff, + Args extends Array, +>( + body: (...args: Args) => Generator, +): ( + ...args: Args +) => Effect< + AEff, + [Eff] extends [Effect] ? E : never, + [Eff] extends [Effect] ? R : never +>; + +interface Tag { + readonly _op: "Tag"; + readonly Service: Value; + readonly Identifier: Id; +} + +interface TagClassShape { + readonly Type: Shape; + readonly Id: Id; +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; + readonly key: Id; +} + +declare function layerEffect( + tag: Tag, + effect: Effect, +): unknown; + +declare function Tag( + id: Id, +): () => TagClass; + +class Foo extends Tag("Foo")< + Foo, + { + fn: (a: string) => Effect; + } +>() {} + +layerEffect( + Foo, + effectGen(function* () { + return { + fn: effectFn(function* (a) { + a; // string + }), + }; + }), +); diff --git a/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference4.ts b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference4.ts new file mode 100644 index 0000000000000..19a7f07f54bab --- /dev/null +++ b/tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference4.ts @@ -0,0 +1,62 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +type Covariant = (_: never) => A; + +interface Effect { + readonly _A: Covariant; + readonly _E: Covariant; + readonly _R: Covariant; +} + +declare function effectGen( + f: () => Generator, AEff, never>, +): Effect; + +declare function effectFn>( + body: (...args: Args) => Generator, AEff, never>, +): (...args: Args) => Effect; + +interface Tag { + readonly _op: "Tag"; + readonly Service: Value; + readonly Identifier: Id; +} + +interface TagClassShape { + readonly Type: Shape; + readonly Id: Id; +} + +interface TagClass extends Tag { + new (_: never): TagClassShape; + readonly key: Id; +} + +declare function layerEffect( + tag: Tag, + effect: Effect, +): unknown; + +declare function Tag( + id: Id, +): () => TagClass; + +class Foo extends Tag("Foo")< + Foo, + { + fn: (a: string) => Effect; + } +>() {} + +layerEffect( + Foo, + effectGen(function* () { + return { + fn: effectFn(function* (a) { + a; // string + }), + }; + }), +); diff --git a/tests/cases/compiler/declareDottedExtend.ts b/tests/cases/compiler/declareDottedExtend.ts index 2ee2086cb3a03..462bca45cad5d 100644 --- a/tests/cases/compiler/declareDottedExtend.ts +++ b/tests/cases/compiler/declareDottedExtend.ts @@ -1,4 +1,4 @@ -declare module A.B +declare namespace A.B { export class C{ } } diff --git a/tests/cases/compiler/dottedModuleName2.ts b/tests/cases/compiler/dottedModuleName2.ts index ece392a9ed1cd..a68e65c6c1640 100644 --- a/tests/cases/compiler/dottedModuleName2.ts +++ b/tests/cases/compiler/dottedModuleName2.ts @@ -19,7 +19,7 @@ var tmpOK = AA.B.x; var tmpError = A.B.x; -module A.B.C +namespace A.B.C { @@ -29,7 +29,7 @@ module A.B.C -module M +namespace M { diff --git a/tests/cases/compiler/escapedIdentifiers.ts b/tests/cases/compiler/escapedIdentifiers.ts index c220bd1932098..76f3632f7cba7 100644 --- a/tests/cases/compiler/escapedIdentifiers.ts +++ b/tests/cases/compiler/escapedIdentifiers.ts @@ -25,7 +25,7 @@ b ++; namespace moduleType1 { export var baz1: number; } -module moduleType\u0032 { +declare module moduleType\u0032 { export var baz2: number; } diff --git a/tests/cases/compiler/functionInIfStatementInModule.ts b/tests/cases/compiler/functionInIfStatementInModule.ts index 1bb53ee9b19cf..485928b0b9892 100644 --- a/tests/cases/compiler/functionInIfStatementInModule.ts +++ b/tests/cases/compiler/functionInIfStatementInModule.ts @@ -1,5 +1,5 @@ -module Midori +namespace Midori { if (false) { function Foo(src) diff --git a/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts b/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts index cf7f97be34c69..d5e319a954473 100644 --- a/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts +++ b/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall1.ts @@ -30,3 +30,40 @@ declare const inner2: { outer(function* (value: T) { const result = yield* inner2(value); // error }); + +declare const inner3: { + (value: A): { + (): A; + [Symbol.iterator](): { + next(...args: ReadonlyArray): IteratorResult; + }; + }; +}; + +declare function outer2(body: (value: A) => Generator): Y; + +// number +const result1 = outer2(function* (value: T) { + yield* inner3(value); +}); + +// number +const result2 = outer2(function* (value: T) { + const x = inner3(value); + yield* x; +}); + +declare function outer3( + body: (value: A) => Generator, +): void; + +// error +outer3(function* (value: T) { + yield* inner3(value); +}); + +// error +outer3(function* (value: T) { + const x = inner3(value); + yield* x; +}); diff --git a/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts b/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts new file mode 100644 index 0000000000000..571ecce45f79e --- /dev/null +++ b/tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts @@ -0,0 +1,49 @@ +// @strict: true +// @target: esnext +// @lib: esnext +// @noEmit: true + +type ReadonlyRecord = { + readonly [P in K]: A; +}; + +type Success = T extends Micro ? _A : never; + +interface MicroIterator> { + next(...args: ReadonlyArray): IteratorResult>; +} + +interface Micro { + _A: A; + _E: E; + _R: R; + [Symbol.iterator](): MicroIterator>; +} + +declare function runPromise(effect: Micro): Promise; + +declare function gen, AEff>( + body: () => Generator, +): Micro; + +declare const traverse: { + ( + f: (a: A) => Micro, + ): ( + self: ReadonlyRecord, + ) => Micro, E, O>; + ( + self: ReadonlyRecord, + f: (a: A) => Micro, + ): Micro, E, O>; +}; + +runPromise( + gen(function* () { + yield* traverse({ a: 1, b: 2 }, (n) => + gen(function* () { + return n + 1; + }), + ); + }), +); diff --git a/tests/cases/compiler/inferenceContextualReturnTypeUnion1.ts b/tests/cases/compiler/inferenceContextualReturnTypeUnion1.ts new file mode 100644 index 0000000000000..ab3963fd9d62a --- /dev/null +++ b/tests/cases/compiler/inferenceContextualReturnTypeUnion1.ts @@ -0,0 +1,19 @@ +// @strict: true +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/50719 + +declare function useCallback1(fn: T): T; + +declare function ex2(callback?: (x: number) => void): void; +ex2(useCallback1((x) => {})); + +declare function ex3(callback: ((x: number) => void) | 5): void; +ex3(useCallback1((x) => {})); + +// https://github.com/microsoft/TypeScript/issues/41461 + +declare function useCallback2 any>( + callback: T, +): T; +const test: ((x: string) => void) | undefined = useCallback2((x) => {}); diff --git a/tests/cases/compiler/inferenceContextualReturnTypeUnion2.ts b/tests/cases/compiler/inferenceContextualReturnTypeUnion2.ts new file mode 100644 index 0000000000000..020249134492d --- /dev/null +++ b/tests/cases/compiler/inferenceContextualReturnTypeUnion2.ts @@ -0,0 +1,35 @@ +// @strict: true +// @lib: esnext, dom +// @noEmit: true + +type Query = ( + container: HTMLElement, + ...args: any[] +) => + | Error + | HTMLElement + | HTMLElement[] + | Promise + | Promise + | null; + +interface Queries { + [T: string]: Query; +} + +type FindByText = ( + container: HTMLElement, + text: string, +) => Promise; + +declare function findByLabelText( + ...args: Parameters> +): ReturnType>; + +const queries = { + findByLabelText, +}; + +type MapQueries = { + [P in keyof Q]: Q[P]; +}; diff --git a/tests/cases/compiler/inferenceContextualReturnTypeUnion3.ts b/tests/cases/compiler/inferenceContextualReturnTypeUnion3.ts new file mode 100644 index 0000000000000..195900bfc38f1 --- /dev/null +++ b/tests/cases/compiler/inferenceContextualReturnTypeUnion3.ts @@ -0,0 +1,44 @@ +// @strict: true +// @lib: esnext +// @noEmit: true + +declare function deprecate( + fn: T, + msg: string, + code?: string, +): T; + +const soonFrozenObjectDeprecation = ( + obj: T, + name: string, + code: string, + note = "", +): T => { + const message = `${name} will be frozen in future, all modifications are deprecated.${ + note && `\n${note}` + }`; + return new Proxy(obj, { + set: deprecate( + (target, property, value, receiver) => + Reflect.set(target, property, value, receiver), + message, + code, + ), + defineProperty: deprecate( + (target, property, descriptor) => + Reflect.defineProperty(target, property, descriptor), + message, + code, + ), + deleteProperty: deprecate( + (target, property) => Reflect.deleteProperty(target, property), + message, + code, + ), + setPrototypeOf: deprecate( + (target, proto) => Reflect.setPrototypeOf(target, proto), + message, + code, + ), + }); +}; \ No newline at end of file diff --git a/tests/cases/compiler/inferenceContextualReturnTypeUnion4.ts b/tests/cases/compiler/inferenceContextualReturnTypeUnion4.ts new file mode 100644 index 0000000000000..cbc69df35b2af --- /dev/null +++ b/tests/cases/compiler/inferenceContextualReturnTypeUnion4.ts @@ -0,0 +1,17 @@ +// @strict: true +// @lib: esnext +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/57905 + +export abstract class Storage { + abstract get(): T | Promise; +} + +export abstract class SyncStorage extends Storage { + abstract override get(): T; +} + +export abstract class ASyncStorage extends Storage { + abstract override get(): Promise; +} diff --git a/tests/cases/compiler/moduleClassArrayCodeGenTest.ts b/tests/cases/compiler/moduleClassArrayCodeGenTest.ts index 3d30b9a9fa821..07a9b8dd7c260 100644 --- a/tests/cases/compiler/moduleClassArrayCodeGenTest.ts +++ b/tests/cases/compiler/moduleClassArrayCodeGenTest.ts @@ -1,6 +1,6 @@ // Invalid code gen for Array of Module class -module M +namespace M { export class A { } class B{ } diff --git a/tests/cases/compiler/moduleKeywordDeprecated.ts b/tests/cases/compiler/moduleKeywordDeprecated.ts new file mode 100644 index 0000000000000..08c5c0c94cb14 --- /dev/null +++ b/tests/cases/compiler/moduleKeywordDeprecated.ts @@ -0,0 +1,21 @@ +// @filename: foo.ts + +// Error +module notok { } +module not.ok { } +declare module bad { } +declare module also.bad { } + +// Still the only way to do it +declare module "good" { } + +// @filename: decl.d.ts + +declare module foo { } +declare module foo.bar { } + +// Still the only way to do it +declare module "alsogood" { } + +export module exported { } +export module exported.sub { } diff --git a/tests/cases/compiler/moduleMerge.ts b/tests/cases/compiler/moduleMerge.ts index 94ca217fc115e..de1ae22d58106 100644 --- a/tests/cases/compiler/moduleMerge.ts +++ b/tests/cases/compiler/moduleMerge.ts @@ -1,6 +1,6 @@ // This should not compile both B classes are in the same module this should be a collission -module A +namespace A { class B { @@ -11,7 +11,7 @@ module A } } -module A +namespace A { export class B { diff --git a/tests/cases/compiler/moduleScopingBug.ts b/tests/cases/compiler/moduleScopingBug.ts index 53f0f7c84c251..3b33be8e18324 100644 --- a/tests/cases/compiler/moduleScopingBug.ts +++ b/tests/cases/compiler/moduleScopingBug.ts @@ -1,4 +1,4 @@ -module M +namespace M { diff --git a/tests/cases/compiler/namedFunctionExpressionInModule.ts b/tests/cases/compiler/namedFunctionExpressionInModule.ts index 66a6b7a545edc..f4da02d6ad273 100644 --- a/tests/cases/compiler/namedFunctionExpressionInModule.ts +++ b/tests/cases/compiler/namedFunctionExpressionInModule.ts @@ -1,4 +1,4 @@ -module Variables{ +namespace Variables{ var x = function bar(a, b, c) { } x(1, 2, 3); diff --git a/tests/cases/compiler/nestedModulePrivateAccess.ts b/tests/cases/compiler/nestedModulePrivateAccess.ts index 6770321fd4685..7625d4b8af074 100644 --- a/tests/cases/compiler/nestedModulePrivateAccess.ts +++ b/tests/cases/compiler/nestedModulePrivateAccess.ts @@ -1,6 +1,6 @@ -module a{ +namespace a{ var x:number; - module b{ + namespace b{ var y = x; // should not be an error } } \ No newline at end of file diff --git a/tests/cases/compiler/parseInvalidNames.ts b/tests/cases/compiler/parseInvalidNames.ts index 2808283ba4b3a..d20f9804a9d94 100644 --- a/tests/cases/compiler/parseInvalidNames.ts +++ b/tests/cases/compiler/parseInvalidNames.ts @@ -1,9 +1,7 @@ namespace 100 {} interface 100 {} -namespace 100 {} type 100 {} export namespace 100 {} export interface 100 {} -export namespace 100 {} export type 100 {} diff --git a/tests/cases/compiler/primaryExpressionMods.ts b/tests/cases/compiler/primaryExpressionMods.ts index 7474d8b1e36d0..a0c571435f498 100644 --- a/tests/cases/compiler/primaryExpressionMods.ts +++ b/tests/cases/compiler/primaryExpressionMods.ts @@ -1,4 +1,4 @@ -module M +namespace M { export interface P { x: number; y: number; } export var a = 1; diff --git a/tests/cases/compiler/reachabilityChecks11.ts b/tests/cases/compiler/reachabilityChecks11.ts index 81dbcf3c7ad81..abcafb411331a 100644 --- a/tests/cases/compiler/reachabilityChecks11.ts +++ b/tests/cases/compiler/reachabilityChecks11.ts @@ -4,33 +4,33 @@ // while (true); var x = 1; -module A { +namespace A { while (true); let x; } -module A1 { +namespace A1 { do {} while(true); - module A { + namespace A { interface F {} } } -module A2 { +namespace A2 { while (true); - module A { + namespace A { var x = 1; } } -module A3 { +namespace A3 { while (true); type T = string; } -module A4 { +namespace A4 { while (true); - module A { + namespace A { const enum E { X } } } @@ -51,9 +51,9 @@ function f2() { } } -module B { +namespace B { for (; ;); - module C { + namespace C { } } diff --git a/tests/cases/compiler/reachabilityChecksNoCrash1.ts b/tests/cases/compiler/reachabilityChecksNoCrash1.ts new file mode 100644 index 0000000000000..4c6359c381bcc --- /dev/null +++ b/tests/cases/compiler/reachabilityChecksNoCrash1.ts @@ -0,0 +1,10 @@ +// @strict: true +// @target: esnext + +export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { + const out = []; + for await (const v of asyncIterable) { + out.push(await v); + } + return out; +} diff --git a/tests/cases/compiler/recursiveCloduleReference.ts b/tests/cases/compiler/recursiveCloduleReference.ts index b2745b7cb60b2..d54c1a92935ce 100644 --- a/tests/cases/compiler/recursiveCloduleReference.ts +++ b/tests/cases/compiler/recursiveCloduleReference.ts @@ -1,4 +1,4 @@ -module M +namespace M { export class C { } diff --git a/tests/cases/compiler/returnTypeInferenceContextualParameterTypesInGenerator1.ts b/tests/cases/compiler/returnTypeInferenceContextualParameterTypesInGenerator1.ts new file mode 100644 index 0000000000000..35db556e9d221 --- /dev/null +++ b/tests/cases/compiler/returnTypeInferenceContextualParameterTypesInGenerator1.ts @@ -0,0 +1,59 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +interface Effect { + readonly _A: A; +} + +declare function gen, AEff>( + f: () => Generator +): Effect; + +interface Rpc< + in out Tag extends string, + out Payload = unknown, + out Success = unknown +> { + readonly _tag: Tag; + readonly payloadSchema: Payload; + readonly successSchema: Success; +} + +interface RpcAny { + readonly _tag: string; +} + +type Payload = R extends Rpc + ? _Payload + : never; + +type ResultFrom = R extends Rpc< + infer _Tag, + infer _Payload, + infer _Success +> + ? _Success + : never; + +type ToHandlerFn = ( + payload: Payload +) => ResultFrom; + +type HandlersFrom = { + readonly [Current in Rpc as Current["_tag"]]: ToHandlerFn; +}; + +interface RpcGroup { + toLayer>(build: Effect): unknown; +} + +declare const Rpcs: RpcGroup>; + +export const layerServerHandlers = Rpcs.toLayer( + gen(function* () { + return { + Register: (id) => String(id), + }; + }) +); diff --git a/tests/cases/compiler/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts b/tests/cases/compiler/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts new file mode 100644 index 0000000000000..d33fe8517bcd3 --- /dev/null +++ b/tests/cases/compiler/returnTypeInferenceContextualTypeIgnoreAnyUnknown1.ts @@ -0,0 +1,29 @@ +// @strict: true +// @noEmit: true + +declare function outer1(arg: { prop: any }): void; +declare function outer2(arg: { prop: unknown }): void; + +declare function inner1 any>(arg: T): T; + +const result1 = inner1((arg) => arg); + +outer1({ + prop: inner1((arg) => arg), +}); + +outer2({ + prop: inner1((arg) => arg), +}); + +declare function inner2(arg: T & ((arg: string) => any)): T; + +const result2 = inner2((arg) => arg); + +outer1({ + prop: inner2((arg) => arg), +}); + +outer2({ + prop: inner2((arg) => arg), +}); diff --git a/tests/cases/compiler/reverseMappedTypeInferenceWidening1.ts b/tests/cases/compiler/reverseMappedTypeInferenceWidening1.ts new file mode 100644 index 0000000000000..bbaae1d00e01e --- /dev/null +++ b/tests/cases/compiler/reverseMappedTypeInferenceWidening1.ts @@ -0,0 +1,60 @@ +// @strict: true +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/62720 + +type TypeFunction = (...args: any[]) => ReturnType; +type Flags = { + [flagName: string]: { + type: TypeFunction; + default?: unknown; + }; +}; +type TypeFlag = { + [flag in keyof Schemas]: Schemas[flag] extends { type: TypeFunction } + ? T + : never; +}; + +declare function fn1( + options: Options, +): TypeFlag; + +const result1 = fn1({ + booleanFlag: { type: Boolean }, + booleanFlagDefault: { + type: Boolean, + default: false, + }, +}); +result1.booleanFlag; // boolean +result1.booleanFlagDefault; // boolean + +declare function fn2( + options: Readonly, +): TypeFlag; + +const result2 = fn2({ + booleanFlag: { type: Boolean }, + booleanFlagDefault: { + type: Boolean, + default: false, + }, +}); +result2.booleanFlag; // boolean +result2.booleanFlagDefault; // boolean + +declare function fn3( + options: Readonly, +): Options; + +const result3 = fn3({ + booleanFlag: { type: Boolean }, + booleanFlagDefault: { + type: Boolean, + default: false, // no cursed EPC failure here + }, +}); + +declare function takeType(arg: { type: unknown }): void; +takeType(result3.booleanFlagDefault); diff --git a/tests/cases/compiler/reverseMappedTypeInferenceWidening2.ts b/tests/cases/compiler/reverseMappedTypeInferenceWidening2.ts new file mode 100644 index 0000000000000..56502f73d4f70 --- /dev/null +++ b/tests/cases/compiler/reverseMappedTypeInferenceWidening2.ts @@ -0,0 +1,17 @@ +// @strict: true +// @noEmit: true + +declare function test1>(arg: { + [K in keyof T]: T[K]; +}): T; + +const res1 = test1({ + foo: { + prop: 1, + prop2: "", + }, + bar: { + prop: true, + prop2: null, + }, +}); diff --git a/tests/cases/compiler/selfRef.ts b/tests/cases/compiler/selfRef.ts index 1f8a079789c71..1dd2b09907ebd 100644 --- a/tests/cases/compiler/selfRef.ts +++ b/tests/cases/compiler/selfRef.ts @@ -1,5 +1,5 @@ // @lib: es5 -module M +namespace M { export class Test { diff --git a/tests/cases/compiler/thislessFunctionsNotContextSensitive1.ts b/tests/cases/compiler/thislessFunctionsNotContextSensitive1.ts new file mode 100644 index 0000000000000..e1c340544e72c --- /dev/null +++ b/tests/cases/compiler/thislessFunctionsNotContextSensitive1.ts @@ -0,0 +1,242 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/62204 + +declare function TestConfig( + config: TConfig, + test: keyof Omit extends never ? true : false, +): void; + +TestConfig( + { + a: "hello", + b: function () { + return 123; + }, + }, + true, +); + +TestConfig( + { + a: "hello", + b: function () { + return 123; + }, + }, + false, // error +); + +// https://github.com/microsoft/TypeScript/issues/60986 +interface SubscribeFieldOptions { + subscribe: () => Event; + resolve: (event: Event) => number; +} + +declare function defineOptions( + options: SubscribeFieldOptions, +): void; + +defineOptions({ + resolve: (event) => event, // number + subscribe() { + return 123; + }, +}); + +defineOptions({ + resolve: (event) => event, // number + subscribe: function () { + return 123; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/58630 + +export type StateFunction = (s: State, ...args: any[]) => any; + +export type VuexStoreOptions = { + state?: State | (() => State) | { (): State }; + mutations?: Record>; + modules?: { + [k in keyof Modules]: VuexStoreOptions; + }; +}; + +export function createStore< + State extends Record, + Modules extends Record>, +>(options: VuexStoreOptions) {} + +const store = createStore({ + state() { + return { bar2: 1 }; + }, + mutations: { inc: (state123) => state123.bar2++ }, + modules: { + foo: { + state() { + return { bar2: 1 }; + }, + mutations: { inc: (state) => state.bar2++ }, + }, + }, +}); + +// https://github.com/microsoft/TypeScript/issues/57572 + +type C = void>(options: { + methods: Methods; + attached: Attached; +}) => any; + +var Component: C = () => {}; + +Component({ + attached(methods) { + methods.bbb(); // ok + }, + methods: { + bbb() {}, + }, +}); + +Component({ + attached(methods) { + methods.bbb(); // ok + }, + methods: { + bbb: () => {}, + }, +}); + +// https://github.com/microsoft/TypeScript/issues/56067 + +declare function create56067< + State extends Record, + Data extends Record, + Actions extends (state: State, data: Data) => Record, +>(args: { getState: () => State; actions: Actions; getData: () => Data }): void; + +create56067({ + getState() { + return { a: 1 }; + }, + getData: () => { + return { b: 2 }; + }, + actions(state, data) { + state // { a: number } + data; // { b: number } + return { + z: 1, + }; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/55489 +type NonStringIterable = + T extends string ? never : T extends Iterable ? T : never; + +declare function doSomething(value: NonStringIterable): T; + +const o = { foo() {} }; + +doSomething('value'); // error +doSomething(['v']); // ok +doSomething([o]); // ok +doSomething([{ foo() {} }]); // ok + +// https://github.com/microsoft/TypeScript/issues/55124 +type Values = T[keyof T]; +type ExtractFields = Values<{ + [K in keyof Options]: Options[K] extends object ? keyof Options[K] : never; +}>; +type SetType = { + [key: string]: any; + target?: ExtractFields; +}; + +declare function test55124>( + options: OptionsData, +): void; + +test55124({ + target: "$test4", // ok + data1: { + $test1: 111, + $test2: null, + }, + data2: { + $test3: {}, + $test4: () => {}, + $test5() {}, + }, +}); + +test55124({ + target: "$test6", // error + data1: { + $test1: 111, + $test2: null, + }, + data2: { + $test3: {}, + $test4: () => {}, + $test5() {}, + }, +}); + +// https://github.com/microsoft/TypeScript/issues/53924 +function test53924(options: { a: (c: T) => void; b: () => T }) {} + +test53924({ + a: (c) => { + c; // number; + }, + b: () => 123, +}); + +test53924({ + b: () => 123, + a: (c) => { + return c; // number + }, +}); + +test53924({ + b() { + return 123; + }, + a(c) { + return c; // number + }, +}); + +test53924({ + a(c) { + return c; // number + }, + b() { + return 123; + }, +}); + +// https://github.com/microsoft/TypeScript/issues/50258 +declare function monitor any>( + extractor: (...args: Parameters) => Record, + executor: T, +): (...args: Parameters) => ReturnType; + +monitor( + (p) => ({ p }), // { p: number } + (p: number) => p, +); +monitor( + (p) => ({ p }), // { p: number } + function (p: number) { + return p; + }, +); diff --git a/tests/cases/compiler/thislessFunctionsNotContextSensitive2.ts b/tests/cases/compiler/thislessFunctionsNotContextSensitive2.ts new file mode 100644 index 0000000000000..946dfc69179a7 --- /dev/null +++ b/tests/cases/compiler/thislessFunctionsNotContextSensitive2.ts @@ -0,0 +1,125 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +interface Options { + context: Context; + produce(this: Context): Data; + consume(this: Context, data: Data): void; +} + +declare function defineOptions( + options: Options, +): [Context, Data]; + +const result1 = defineOptions({ + context: { tag: "A", value: 1 }, + consume(_data) {}, + produce() { + return 42; + }, +}); + +const result2 = defineOptions({ + context: { tag: "B", value: 2 }, + consume(_data) {}, + produce() { + return this.value; + }, +}); + +const result3 = defineOptions({ + context: { tag: "C", value: 3 }, + consume(_data) {}, + produce: () => 123, +}); + +const result4 = defineOptions({ + context: { tag: "D", value: 4 }, + consume(_data) {}, + produce() { + class Local { + value = 'foo'; + get() { + return this.value; + } + } + return new Local().get();; + }, +}); + +const result5 = defineOptions({ + context: { tag: "E", value: 5 }, + consume(_data) {}, + produce() { + function inner() { + return this; + } + return inner(); + }, +}); + +const result6 = defineOptions({ + context: { tag: "F", value: 6 }, + consume(_data) {}, + produce() { + const arrow = () => this.value; + return arrow(); + }, +}); + +const result7 = defineOptions({ + context: { tag: "G", value: 7 }, + consume(_data) {}, + produce() { + const self = this; + function inner() { + return self.value; + } + return inner(); + }, +}); + +const result8 = defineOptions({ + context: { tag: "H", value: 8 }, + consume(_data) {}, + produce: () => { + return this; + }, +}); + +const result9 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + const obj = { + value: 'foo', + get() { + return this.value; + }, + }; + return obj.get(); + }, +}); + +const result10 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + interface Foo { + prop: this; + } + return {} as Foo; + }, +}); + +const result11 = defineOptions({ + context: { tag: "I", value: 9 }, + consume(_data) {}, + produce() { + function fn(this: { prop: string }) { + return this.prop; + } + return fn; + }, +}); diff --git a/tests/cases/compiler/thislessFunctionsNotContextSensitive3.ts b/tests/cases/compiler/thislessFunctionsNotContextSensitive3.ts new file mode 100644 index 0000000000000..d730208cce63e --- /dev/null +++ b/tests/cases/compiler/thislessFunctionsNotContextSensitive3.ts @@ -0,0 +1,116 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +declare class Editor { + private _editor; +} + +declare class Plugin { + private _plugin; +} + +type ParentConfig = Partial<{ + [P in keyof T]: Required[P] extends (...args: any) => any + ? (...args: Parameters[P]>) => ReturnType[P]> + : T[P]; +}>; + +interface ExtendableConfig< + Options = any, + Config extends + | ExtensionConfig + | ExtendableConfig = ExtendableConfig, +> { + name: string; + addOptions?: (this: { + name: string; + parent: ParentConfig["addOptions"]; + }) => Options; + addProseMirrorPlugins?: (this: { + options: Options; + editor: Editor; + }) => Plugin[]; +} + +interface ExtensionConfig + extends ExtendableConfig> {} + +declare class Extension { + _options: Options; + + static create(config: Partial>): Extension; + + configure(options?: Partial): Extension; +} + +interface SuggestionOptions { + editor: Editor; + char?: string; +} + +declare function Suggestion(options: SuggestionOptions): Plugin; + +Extension.create({ + name: "slash-command", + addOptions() { + return { + suggestion: { + char: "/", + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { + return [ + Suggestion({ + editor: this.editor, // error + ...this.options.suggestion, + }), + ]; + }, +}); + +Extension.create({ + name: "slash-command", + addOptions: () => { + return { + suggestion: { + char: "/", + } as SuggestionOptions, + }; + }, + addProseMirrorPlugins() { + return [ + Suggestion({ + editor: this.editor, // error + ...this.options.suggestion, + }), + ]; + }, +}); + +const parentExtension = Extension.create({ + name: "parentExtension", + addOptions() { + return { parent: "exists", overwrite: "parent" }; + }, +}); + +const childExtension = parentExtension.configure({ + child: "exists-too", // error + overwrite: "child", +}); + +const parentExtension2 = Extension.create({ + name: "parentExtension2", + addOptions: () => { + return { parent: "exists", overwrite: "parent" }; + }, +}); + +const childExtension2 = parentExtension2.configure({ + child: "exists-too", // error + overwrite: "child", +}); + +export {}; diff --git a/tests/cases/compiler/unexportedInstanceClassVariables.ts b/tests/cases/compiler/unexportedInstanceClassVariables.ts index 1a45b5c0211f0..1d09e27b67638 100644 --- a/tests/cases/compiler/unexportedInstanceClassVariables.ts +++ b/tests/cases/compiler/unexportedInstanceClassVariables.ts @@ -1,10 +1,10 @@ -module M{ +namespace M{ class A{ constructor(val:string){} } } -module M{ +namespace M{ class A {} var a = new A(); diff --git a/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck64.ts b/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck64.ts new file mode 100644 index 0000000000000..30e9e40d96f81 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck64.ts @@ -0,0 +1,15 @@ +// @strict: true +// @target: esnext +// @noEmit: true + +function* g3(): Generator number>> { + yield function* () { + yield x => x.length; + } () +} + +function* g4(): Iterator number>> { + yield (function* () { + yield (x) => x.length; + })(); +} diff --git a/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts b/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts index 2e09672ed4278..edd23b90d3ce5 100644 --- a/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts +++ b/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts @@ -5,7 +5,7 @@ namespace A { } } -module A{ +namespace A{ // expected error export class Point { origin: number; diff --git a/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts b/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts index 734f65b0c563d..fe49116404e89 100644 --- a/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts +++ b/tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts @@ -2,7 +2,7 @@ namespace A.B { export var x: number; } -module A{ +namespace A{ namespace B { export var x: string; } diff --git a/tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts b/tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts index 594844cf38dc3..03021576ea5fe 100644 --- a/tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts +++ b/tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts @@ -1,3 +1,3 @@ let module = 10; -namespace in {} \ No newline at end of file +module in {} \ No newline at end of file diff --git a/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts b/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts new file mode 100644 index 0000000000000..4b0ca480bc853 --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcard.ts @@ -0,0 +1,42 @@ +// @module: nodenext +// @declaration: true +// @traceResolution: true +// @filename: package.json +{ + "name": "package", + "private": true, + "type": "module", + "imports": { + "#/*": "./src/*" + } +} +// @filename: src/foo.ts +export const foo = "foo"; +// @filename: src/features/bar.ts +export const bar = "bar"; +// @filename: src/nested/deep/baz.ts +export const baz = "baz"; +// @filename: index.ts +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +// @filename: index.mts +// esm format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; +// @filename: index.cts +// cjs format file +import { foo } from "#/foo.js"; +import { bar } from "#/features/bar.js"; +import { baz } from "#/nested/deep/baz.js"; +foo; +bar; +baz; diff --git a/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts b/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts new file mode 100644 index 0000000000000..edd2b10c5abff --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesPackageImportsRootWildcardNode16.ts @@ -0,0 +1,18 @@ +// @module: node16 +// @declaration: true +// @traceResolution: true +// @filename: package.json +{ + "name": "package", + "private": true, + "type": "module", + "imports": { + "#/*": "./src/*" + } +} +// @filename: src/foo.ts +export const foo = "foo"; +// @filename: index.ts +// esm format file +import { foo } from "#/foo.js"; +foo; diff --git a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.1.ts b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.1.ts index 7f7f86bd4410f..71ab320393561 100644 --- a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.1.ts +++ b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.1.ts @@ -42,61 +42,72 @@ class C1 { } switch (Math.random()) { - case 0: + case 0: { await using d20 = { async [Symbol.asyncDispose]() {} }; break; + } - case 1: + case 1: { await using d21 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d22 = { async [Symbol.asyncDispose]() {} }; + } } if (true) switch (0) { - case 0: - await using d22 = { async [Symbol.asyncDispose]() {} }; + case 0: { + await using d23 = { async [Symbol.asyncDispose]() {} }; break; + } + + default: { + await using d24 = { async [Symbol.asyncDispose]() {} }; + } } try { - await using d23 = { async [Symbol.asyncDispose]() {} }; + await using d25 = { async [Symbol.asyncDispose]() {} }; } catch { - await using d24 = { async [Symbol.asyncDispose]() {} }; + await using d26 = { async [Symbol.asyncDispose]() {} }; } finally { - await using d25 = { async [Symbol.asyncDispose]() {} }; + await using d27 = { async [Symbol.asyncDispose]() {} }; } if (true) { - await using d26 = { async [Symbol.asyncDispose]() {} }; + await using d28 = { async [Symbol.asyncDispose]() {} }; } else { - await using d27 = { async [Symbol.asyncDispose]() {} }; + await using d29 = { async [Symbol.asyncDispose]() {} }; } while (true) { - await using d28 = { async [Symbol.asyncDispose]() {} }; + await using d30 = { async [Symbol.asyncDispose]() {} }; break; } do { - await using d29 = { async [Symbol.asyncDispose]() {} }; + await using d31 = { async [Symbol.asyncDispose]() {} }; break; } while (true); for (;;) { - await using d30 = { async [Symbol.asyncDispose]() {} }; + await using d32 = { async [Symbol.asyncDispose]() {} }; break; } for (const x in {}) { - await using d31 = { async [Symbol.asyncDispose]() {} }; + await using d33 = { async [Symbol.asyncDispose]() {} }; } for (const x of []) { - await using d32 = { async [Symbol.asyncDispose]() {} }; + await using d34 = { async [Symbol.asyncDispose]() {} }; } export {}; \ No newline at end of file diff --git a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.17.ts b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.17.ts new file mode 100644 index 0000000000000..21b021fb1ddb4 --- /dev/null +++ b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.17.ts @@ -0,0 +1,29 @@ +// @target: esnext +// @module: esnext +// @lib: esnext +// @noTypesAndSymbols: true + +switch (Math.random()) { + case 0: + await using d20 = { async [Symbol.asyncDispose]() {} }; + break; + + case 1: + await using d21 = { async [Symbol.asyncDispose]() {} }; + break; + + default: + await using d22 = { async [Symbol.asyncDispose]() {} }; +} + +if (true) + switch (0) { + case 0: + await using d23 = { async [Symbol.asyncDispose]() {} }; + break; + + default: + await using d24 = { async [Symbol.asyncDispose]() {} }; + } + +export {}; diff --git a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.1.ts b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.1.ts index 48339bbdd072b..9cc4228a349f7 100644 --- a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.1.ts +++ b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.1.ts @@ -96,61 +96,72 @@ namespace N { } switch (Math.random()) { - case 0: + case 0: { using d20 = { [Symbol.dispose]() {} }; break; + } - case 1: + case 1: { using d21 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d22 = { [Symbol.dispose]() {} }; + } } if (true) switch (0) { - case 0: - using d22 = { [Symbol.dispose]() {} }; + case 0: { + using d23 = { [Symbol.dispose]() {} }; break; + } + + default: { + using d24 = { [Symbol.dispose]() {} }; + } } try { - using d23 = { [Symbol.dispose]() {} }; + using d25 = { [Symbol.dispose]() {} }; } catch { - using d24 = { [Symbol.dispose]() {} }; + using d26 = { [Symbol.dispose]() {} }; } finally { - using d25 = { [Symbol.dispose]() {} }; + using d27 = { [Symbol.dispose]() {} }; } if (true) { - using d26 = { [Symbol.dispose]() {} }; + using d28 = { [Symbol.dispose]() {} }; } else { - using d27 = { [Symbol.dispose]() {} }; + using d29 = { [Symbol.dispose]() {} }; } while (true) { - using d28 = { [Symbol.dispose]() {} }; + using d30 = { [Symbol.dispose]() {} }; break; } do { - using d29 = { [Symbol.dispose]() {} }; + using d31 = { [Symbol.dispose]() {} }; break; } while (true); for (;;) { - using d30 = { [Symbol.dispose]() {} }; + using d32 = { [Symbol.dispose]() {} }; break; } for (const x in {}) { - using d31 = { [Symbol.dispose]() {} }; + using d33 = { [Symbol.dispose]() {} }; } for (const x of []) { - using d32 = { [Symbol.dispose]() {} }; + using d34 = { [Symbol.dispose]() {} }; } export {}; \ No newline at end of file diff --git a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.17.ts b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.17.ts new file mode 100644 index 0000000000000..6b3eef52e2e9b --- /dev/null +++ b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarations.17.ts @@ -0,0 +1,29 @@ +// @target: esnext +// @module: esnext +// @lib: esnext +// @noTypesAndSymbols: true + +switch (Math.random()) { + case 0: + using d20 = { [Symbol.dispose]() {} }; + break; + + case 1: + using d21 = { [Symbol.dispose]() {} }; + break; + + default: + using d22 = { [Symbol.dispose]() {} }; +} + +if (true) + switch (0) { + case 0: + using d23 = { [Symbol.dispose]() {} }; + break; + + default: + using d24 = { [Symbol.dispose]() {} }; + } + +export {}; diff --git a/tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts new file mode 100644 index 0000000000000..2bcdc71a0df54 --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties2.ts @@ -0,0 +1,23 @@ +/// + +//// type C = { +//// foo: string; +//// bar: number; +//// }; +//// +//// declare function fn(arg: T): T; +//// +//// fn({ +//// foo/*1*/: "", +//// bar/*2*/: true, +//// }); +//// +//// const result = fn({ +//// foo/*3*/: "", +//// bar/*4*/: 1, +//// }); +//// +//// // this one shouldn't go to the constraint type +//// result.foo/*5*/; + +verify.baselineGoToDefinition("1", "2", "3", "4", "5"); diff --git a/tests/cases/fourslash/goToDefinitionObjectLiteralProperties3.ts b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties3.ts new file mode 100644 index 0000000000000..6e9514f018d78 --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties3.ts @@ -0,0 +1,24 @@ +/// + +//// type A = { +//// foo: unknown; +//// }; +//// +//// type B = { +//// foo?: unknown; +//// bar: unknown; +//// }; +//// +//// function test1(arg: A | B) {} +//// +//// test1({ +//// foo/*1*/: 1, +//// }); +//// +//// function test2(arg: T | B) {} +//// +//// test2({ +//// foo/*2*/: 2, +//// }); + +verify.baselineGoToDefinition("1", "2"); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPatternRootWildcard.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPatternRootWildcard.ts new file mode 100644 index 0000000000000..304d799d44b70 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPatternRootWildcard.ts @@ -0,0 +1,25 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#/*": "./src/*" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /src/features/bar.ts +//// export function bar(): any; + +// @Filename: /a.ts +//// import {} from "#//*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["something.js", "features"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts b/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts deleted file mode 100644 index 5554300a5a0b9..0000000000000 --- a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -// @Filename: a.ts -////[|module|] mod1 { export let x: number } -////declare [|module|] mod2 { export let x: number } -////export [|module|] mod3 { export let x: number } -////export declare [|module|] mod4 { export let x: number } -////namespace mod5 { export let x: number } -////declare namespace mod6 { export let x: number } -////declare module "module-augmentation" {} -////declare global {} -////mod1.x = 1; -////mod2.x = 1; -////mod5.x = 1; -////mod6.x = 1; - -// @Filename: b.ts -////module "global-ambient-module" {} - -goTo.file("a.ts") -const diagnostics = test.ranges().map(range => ({ - code: 1540, - message: "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.", - reportsDeprecated: true, - range, -})); -verify.getSuggestionDiagnostics(diagnostics) - -goTo.file("b.ts") -verify.getSuggestionDiagnostics([]) - diff --git a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion2.ts b/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion2.ts deleted file mode 100644 index f592302417d0b..0000000000000 --- a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion2.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -// @Filename: a.ts -////declare module - -const ranges = test.ranges(); -verify.getSuggestionDiagnostics([]) diff --git a/tests/cases/fourslash/stringLiteralCompletionsWithinInferredObjectWhenItsKeysAreUsedOutsideOfIt.ts b/tests/cases/fourslash/stringLiteralCompletionsWithinInferredObjectWhenItsKeysAreUsedOutsideOfIt.ts new file mode 100644 index 0000000000000..55ce6d20995b7 --- /dev/null +++ b/tests/cases/fourslash/stringLiteralCompletionsWithinInferredObjectWhenItsKeysAreUsedOutsideOfIt.ts @@ -0,0 +1,33 @@ +/// + +// @strict: true + +//// declare function createMachine(config: { +//// initial: keyof T; +//// states: { +//// [K in keyof T]: { +//// on?: Record; +//// }; +//// }; +//// }): void; +//// +//// createMachine({ +//// initial: "a", +//// states: { +//// a: { +//// on: { +//// NEXT: "/*1*/", +//// }, +//// }, +//// b: { +//// on: { +//// NEXT: "/*2*/", +//// }, +//// }, +//// }, +//// }); + +verify.completions({ + marker: ["1", "2"], + exact: ["a", "b"] +}) diff --git a/tests/cases/fourslash/typeErrorAfterStringCompletionsInNestedCall.ts b/tests/cases/fourslash/typeErrorAfterStringCompletionsInNestedCall.ts index 6a9909c4a20e3..ce3d5fa967c32 100644 --- a/tests/cases/fourslash/typeErrorAfterStringCompletionsInNestedCall.ts +++ b/tests/cases/fourslash/typeErrorAfterStringCompletionsInNestedCall.ts @@ -25,7 +25,7 @@ goTo.marker("1"); edit.insert(`x`) -verify.completions({ exact: ["MORNING", "LUNCH_TIME", "ALOHA"] }); +verify.completions({ exact: ["ALOHAx", "MORNING", "LUNCH_TIME", "ALOHA"] }); verify.getSemanticDiagnostics([{ code: 2322, message: `Type 'RaiseActionObject<{ type: "ALOHAx"; }>' is not assignable to type 'RaiseActionObject'.\n Type '{ type: "ALOHAx"; }' is not assignable to type 'GreetingEvent'.\n Type '{ type: "ALOHAx"; }' is not assignable to type '{ type: "ALOHA"; }'.\n Types of property 'type' are incompatible.\n Type '"ALOHAx"' is not assignable to type '"ALOHA"'.`, diff --git a/tests/cases/fourslash/unreachableCodeAfterEdit.ts b/tests/cases/fourslash/unreachableCodeAfterEdit.ts new file mode 100644 index 0000000000000..af07c67463c98 --- /dev/null +++ b/tests/cases/fourslash/unreachableCodeAfterEdit.ts @@ -0,0 +1,44 @@ +/// + +// @allowUnreachableCode: false +// @lib: es2015 + +// @Filename: /base/browser/browser.ts +//// export const isStandalone = true; + +// @Filename: /base/browser/dom.ts +//// export function addDisposableListener() {} + +// @Filename: /base/browser/window.ts +//// export const mainWindow = {} as Window; + +// @Filename: /workbench.ts +//// /*before*/import { isStandalone } from './base/browser/browser'; +//// import { addDisposableListener } from './base/browser/dom'; +//// import { mainWindow } from './base/browser/window'; +//// +//// interface ISecretStorageCrypto { +//// seal(data: string): Promise; +//// unseal(data: string): Promise; +//// } +//// +//// export class TransparentCrypto implements ISecretStorageCrypto { +//// async seal(data: string): Promise { +//// return data; +//// } +//// async unseal(data: string): Promise { +//// return data; +//// } +//// } + +verify.numberOfErrorsInCurrentFile(0); + +goTo.marker("before"); +edit.insert("throw new Error('foo');\n"); + +verify.numberOfErrorsInCurrentFile(1); + +goTo.marker("before"); +edit.deleteAtCaret("throw new Error('foo');\n".length); + +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/unusedLabelAfterEdit.ts b/tests/cases/fourslash/unusedLabelAfterEdit.ts new file mode 100644 index 0000000000000..eb5fa6991fe7c --- /dev/null +++ b/tests/cases/fourslash/unusedLabelAfterEdit.ts @@ -0,0 +1,23 @@ +/// + +// @allowUnusedLabels: false + +//// myLabel: while (true) { +//// if (Math.random() > 0.5) { +//// /*marker*/break myLabel; +//// } +//// } + +verify.numberOfErrorsInCurrentFile(0); + +goTo.marker("marker"); +edit.deleteAtCaret("break myLabel;".length); +edit.insert("break;"); + +verify.numberOfErrorsInCurrentFile(1); + +goTo.marker("marker"); +edit.deleteAtCaret("break;".length); +edit.insert("break myLabel;"); + +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/projects/DeclareExportAdded/ref.d.ts b/tests/cases/projects/DeclareExportAdded/ref.d.ts index 4ce3adee420c0..242a4eb2e7b8e 100644 --- a/tests/cases/projects/DeclareExportAdded/ref.d.ts +++ b/tests/cases/projects/DeclareExportAdded/ref.d.ts @@ -1,4 +1,4 @@ -declare module M1 +declare namespace M1 { export function f1(): void; } \ No newline at end of file diff --git a/tests/cases/projects/declareVariableCollision/decl.d.ts b/tests/cases/projects/declareVariableCollision/decl.d.ts index 9bcb7bb84b436..69a141268cda7 100644 --- a/tests/cases/projects/declareVariableCollision/decl.d.ts +++ b/tests/cases/projects/declareVariableCollision/decl.d.ts @@ -1,10 +1,10 @@ // bug 535531: duplicate identifier error reported for "import" declarations in separate files -declare module A +declare namespace A { class MyRoot { } - + export module B { class MyClass{ } diff --git a/tests/lib/lib.d.ts b/tests/lib/lib.d.ts index 90f1abd8bb0dc..4db2f7ac2ac56 100644 --- a/tests/lib/lib.d.ts +++ b/tests/lib/lib.d.ts @@ -7,7 +7,7 @@ License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +MERCHANTABILITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.