Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try emitting an error when export would be emitted with different unwidened type #55860

Closed
wants to merge 12 commits into from

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Sep 25, 2023

This is a very very bad attempt at making the problems we've found in #55445 into check errors. I guarantee that this PR is wrong, you can see very strange things happening because observing isDeclarationVisible of each declaration passed to checkVariableLikeDeclaration seems to cause a side effect (???), and my check is poorly copied from declarations.ts so has some improper edge cases.

In any case, it still catches everything we mentioned in #55445 so it's somewhat interesting.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 25, 2023
@jakebailey
Copy link
Member Author

@typescript-bot test top200
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at bf925fb. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at bf925fb. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/55860/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 2 instances of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

pyright

/mnt/ts_downloads/pyright/build.sh

  • [NEW] error TS2856: The type of this declaration is ambiguous and may be observed as either 'DiagnosticRule' or 'DiagnosticRule'.
    • /mnt/ts_downloads/pyright/pyright-internal: src/tests/diagnosticOverrides.test.ts(53,85)
    • /mnt/ts_downloads/pyright/pyright-internal: src/tests/diagnosticOverrides.test.ts(95,85)
  • [NEW] error TS2856: The type of this declaration is ambiguous and may be observed as either 'number' or '-1'.
    • /mnt/ts_downloads/pyright/pyright-internal: src/tests/harness/fourslash/fourSlashTypes.ts(110,29)

@jakebailey
Copy link
Member Author

Reading live logs, this seems to be firing on private things, probably because those are "preserved" in d.ts emit but with types removed (but this test PR doesn't model that).

@jakebailey
Copy link
Member Author

@typescript-bot test top100
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 0ca3a1f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 0ca3a1f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/55860/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 2 instances of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

pyright

/mnt/ts_downloads/pyright/build.sh

  • [NEW] error TS2856: The type of this declaration is ambiguous and may be observed as either 'DiagnosticRule' or 'DiagnosticRule'.
    • /mnt/ts_downloads/pyright/pyright-internal: src/tests/diagnosticOverrides.test.ts(53,85)
    • /mnt/ts_downloads/pyright/pyright-internal: src/tests/diagnosticOverrides.test.ts(95,85)

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top-repos suite comparing main and refs/pull/55860/merge:

Something interesting changed - please have a look.

Details

ant-design/ant-design

tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"Link" | "a"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string | ComponentType<any>' or 'ComponentType<any> | "sup"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"" | "bottom" | "top" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | "topCenter" | "bottomCenter"'.

microsoft/playwright

4 of 14 projects failed to build with the old tsc and were ignored

packages/trace-viewer/tsconfig.json

microsoft/vscode

6 of 54 projects failed to build with the old tsc and were ignored

src/tsconfig.monaco.json

neoclide/coc.nvim

tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'number' or '50 | 500'.

niklasvh/html2canvas

1 of 2 projects failed to build with the old tsc and were ignored

tsconfig.json

prisma/prisma

65 of 90 projects failed to build with the old tsc and were ignored

packages/cli/tsconfig.build.json

react-hook-form/react-hook-form

2 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string | TKeyName' or '"id" | TKeyName'.

vercel/swr

5 of 13 projects failed to build with the old tsc and were ignored

test/type/tsconfig.json

vuejs/core

1 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

vuetifyjs/vuetify

4 of 7 projects failed to build with the old tsc and were ignored

packages/vuetify/tsconfig.checks.json

packages/vuetify/tsconfig.dist.json

packages/vuetify/tsconfig.json

Yidadaa/ChatGPT-Next-Web

tsconfig.json

@jakebailey
Copy link
Member Author

A bunch of the above declarations are still ones that shouldn't be visible, so I've clearly still done something wrong.

@jakebailey
Copy link
Member Author

@typescript-bot test top100
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 5560b81. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 25, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 5560b81. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/55860/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 2 instances of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top-repos suite comparing main and refs/pull/55860/merge:

Something interesting changed - please have a look.

Details

microsoft/playwright

4 of 14 projects failed to build with the old tsc and were ignored

packages/trace-viewer/tsconfig.json

microsoft/vscode

6 of 54 projects failed to build with the old tsc and were ignored

src/tsconfig.monaco.json

neoclide/coc.nvim

tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'number' or '50 | 500'.

prisma/prisma

65 of 90 projects failed to build with the old tsc and were ignored

packages/cli/tsconfig.build.json

@jakebailey
Copy link
Member Author

@typescript-bot test top200
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 4ef662f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 4ef662f. You can monitor the build here.

Update: The results are in!

@jakebailey
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 26, 2023

Heya @jakebailey, I've started to run the regular perf test suite on this PR at 4ef662f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/55860/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 2 instances of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 294,948k (± 0.01%) 295,031k (± 0.01%) +83k (+ 0.03%) 294,998k 295,081k p=0.010 n=6
Parse Time 2.62s (± 0.67%) 2.62s (± 0.70%) ~ 2.60s 2.64s p=0.685 n=6
Bind Time 0.84s (± 1.23%) 0.83s (± 0.98%) ~ 0.83s 0.85s p=0.595 n=6
Check Time 8.06s (± 0.26%) 8.18s (± 0.26%) +0.12s (+ 1.53%) 8.15s 8.21s p=0.005 n=6
Emit Time 7.05s (± 0.54%) 7.05s (± 0.43%) ~ 7.02s 7.10s p=1.000 n=6
Total Time 18.56s (± 0.32%) 18.69s (± 0.20%) +0.13s (+ 0.71%) 18.66s 18.76s p=0.005 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,558k (± 1.21%) 191,626k (± 0.71%) ~ 190,717k 193,394k p=1.000 n=6
Parse Time 1.34s (± 0.47%) 1.34s (± 0.87%) ~ 1.32s 1.35s p=0.485 n=6
Bind Time 0.73s (± 0.00%) 0.73s (± 0.00%) ~ 0.73s 0.73s p=1.000 n=6
Check Time 9.12s (± 0.64%) 9.19s (± 0.66%) ~ 9.12s 9.28s p=0.146 n=6
Emit Time 2.62s (± 0.20%) 2.64s (± 0.77%) +0.02s (+ 0.70%) 2.62s 2.68s p=0.035 n=6
Total Time 13.81s (± 0.43%) 13.91s (± 0.37%) +0.09s (+ 0.66%) 13.84s 13.99s p=0.024 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,226k (± 0.00%) 347,235k (± 0.01%) ~ 347,213k 347,259k p=0.196 n=6
Parse Time 2.45s (± 0.66%) 2.46s (± 0.26%) ~ 2.45s 2.47s p=0.615 n=6
Bind Time 0.94s (± 0.00%) 0.94s (± 0.43%) ~ 0.93s 0.94s p=0.405 n=6
Check Time 6.87s (± 0.60%) 6.87s (± 0.78%) ~ 6.81s 6.95s p=0.871 n=6
Emit Time 4.01s (± 0.34%) 4.03s (± 0.70%) ~ 4.00s 4.07s p=0.370 n=6
Total Time 14.28s (± 0.23%) 14.30s (± 0.44%) ~ 14.21s 14.38s p=0.809 n=6
TFS - node (v18.15.0, x64)
Memory used 302,485k (± 0.00%) 302,528k (± 0.01%) +43k (+ 0.01%) 302,480k 302,592k p=0.030 n=6
Parse Time 1.99s (± 1.16%) 1.99s (± 0.45%) ~ 1.98s 2.00s p=1.000 n=6
Bind Time 1.01s (± 0.81%) 1.02s (± 0.74%) +0.01s (+ 1.16%) 1.01s 1.03s p=0.045 n=6
Check Time 6.22s (± 0.38%) 6.28s (± 0.36%) +0.06s (+ 0.91%) 6.25s 6.31s p=0.005 n=6
Emit Time 3.53s (± 0.67%) 3.51s (± 0.82%) ~ 3.49s 3.57s p=0.259 n=6
Total Time 12.74s (± 0.32%) 12.80s (± 0.32%) ~ 12.76s 12.87s p=0.054 n=6
material-ui - node (v18.15.0, x64)
Memory used 470,444k (± 0.00%) 470,452k (± 0.01%) ~ 470,425k 470,501k p=1.000 n=6
Parse Time 2.56s (± 0.16%) 2.58s (± 0.65%) +0.02s (+ 0.72%) 2.56s 2.60s p=0.025 n=6
Bind Time 0.99s (± 1.05%) 0.99s (± 0.99%) ~ 0.98s 1.01s p=0.547 n=6
Check Time 16.58s (± 0.28%) 16.53s (± 0.58%) ~ 16.36s 16.64s p=0.261 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.14s (± 0.23%) 20.10s (± 0.55%) ~ 19.92s 20.25s p=0.336 n=6
xstate - node (v18.15.0, x64)
Memory used 512,542k (± 0.02%) 512,520k (± 0.01%) ~ 512,451k 512,604k p=0.689 n=6
Parse Time 3.27s (± 0.42%) 3.27s (± 0.27%) ~ 3.26s 3.28s p=0.357 n=6
Bind Time 1.55s (± 0.49%) 1.55s (± 0.33%) ~ 1.55s 1.56s p=0.241 n=6
Check Time 2.81s (± 0.49%) 2.83s (± 0.61%) ~ 2.80s 2.85s p=0.139 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 7.71s (± 0.25%) 7.73s (± 0.25%) ~ 7.70s 7.75s p=0.060 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,372ms (± 1.23%) 2,361ms (± 1.01%) ~ 2,327ms 2,383ms p=0.689 n=6
Req 2 - geterr 5,305ms (± 1.32%) 5,394ms (± 1.30%) +89ms (+ 1.68%) 5,315ms 5,474ms p=0.024 n=6
Req 3 - references 331ms (± 1.66%) 332ms (± 1.62%) ~ 324ms 340ms p=0.936 n=6
Req 4 - navto 278ms (± 0.98%) 278ms (± 0.93%) ~ 274ms 281ms p=0.805 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 79ms (± 7.96%) 86ms (± 5.79%) ~ 80ms 91ms p=0.107 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,459ms (± 1.30%) 2,466ms (± 1.09%) ~ 2,425ms 2,489ms p=0.810 n=6
Req 2 - geterr 4,143ms (± 1.99%) 4,226ms (± 1.74%) ~ 4,128ms 4,280ms p=0.066 n=6
Req 3 - references 337ms (± 1.39%) 336ms (± 1.37%) ~ 332ms 342ms p=0.256 n=6
Req 4 - navto 284ms (± 0.19%) 282ms (± 0.72%) ~ 280ms 284ms p=0.232 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 81ms (± 6.69%) 80ms (± 7.63%) ~ 75ms 88ms p=0.730 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,597ms (± 0.49%) 2,593ms (± 0.39%) ~ 2,578ms 2,604ms p=0.689 n=6
Req 2 - geterr 1,694ms (± 1.92%) 1,727ms (± 1.99%) ~ 1,667ms 1,755ms p=0.149 n=6
Req 3 - references 120ms (± 8.22%) 108ms (± 4.20%) 🟩-12ms (-10.26%) 105ms 117ms p=0.033 n=6
Req 4 - navto 360ms (± 0.57%) 360ms (± 0.63%) ~ 358ms 364ms p=0.681 n=6
Req 5 - completionInfo count 2,071 (± 0.00%) 2,071 (± 0.00%) ~ 2,071 2,071 p=1.000 n=6
Req 5 - completionInfo 303ms (± 2.08%) 307ms (± 1.75%) ~ 302ms 314ms p=0.334 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 151.55ms (± 0.16%) 151.75ms (± 0.19%) +0.20ms (+ 0.13%) 150.72ms 155.09ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 227.35ms (± 0.15%) 227.28ms (± 0.17%) -0.07ms (- 0.03%) 225.80ms 232.23ms p=0.009 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 228.89ms (± 0.16%) 228.86ms (± 0.18%) ~ 227.34ms 235.50ms p=0.201 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.74ms (± 0.18%) 228.80ms (± 0.17%) +0.06ms (+ 0.03%) 227.28ms 234.22ms p=0.033 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top-repos suite comparing main and refs/pull/55860/merge:

Something interesting changed - please have a look.

Details

lensterxyz/lenster

apps/prerender/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://lenster.xyz" | "https://testnet.lenster.xyz"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

apps/web/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/data/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/lens/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/lib/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/ui/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/snapshot/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/workers/preferences/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

packages/workers/snapshot-relay/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"production" | "dev"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://hub.snapshot.org" | "https://testnet.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://seq.snapshot.org" | "https://testnet.seq.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot.org" | "https://demo.snapshot.org"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '".lens" | ".test"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://polygonscan.com" | "https://mumbai.polygonscan.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://rarible.com" | "https://testnet.rarible.com"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://sts.lenster.xyz" | "http://localhost:8082"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://metadata.lenster.xyz" | "http://localhost:8083"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://freshdesk.lenster.xyz" | "http://localhost:8084"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://snapshot-relay.lenster.xyz" | "http://localhost:8085"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://ens.lenster.xyz" | "http://localhost:8086"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://oembed.lenster.xyz" | "http://localhost:8087"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://leafwatch.lenster.xyz" | "http://localhost:8088"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://invite.lenster.xyz" | "http://localhost:8090"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://feeds.lenster.xyz" | "http://localhost:8091"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://preferences.lenster.xyz" | "http://localhost:8092"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://channels.lenster.xyz" | "http://localhost:8093"'.
  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string' or '"https://zora.lenster.xyz" | "http://localhost:8094"'.

microsoft/vscode

6 of 54 projects failed to build with the old tsc and were ignored

src/tsconfig.monaco.json

prisma/prisma

65 of 90 projects failed to build with the old tsc and were ignored

packages/cli/tsconfig.build.json

reduxjs/redux

3 of 5 projects failed to build with the old tsc and were ignored

test/tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string | unique symbol' or 'unique symbol | "@@observable"'.

tsconfig.json

  • error TS2856: The type of this declaration is ambiguous and may be observed as either 'string | unique symbol' or 'unique symbol | "@@observable"'.

@DanielRosenwasser
Copy link
Member

@jakebailey you mentioned examples where this doesn't just solve a divergence of declaration emit, and maybe I missed the specifics in the design meeting. Can you write up/show what this solves more explicitly?

@jakebailey
Copy link
Member Author

Yes, I am building an example repo now!

@jakebailey
Copy link
Member Author

Example: https://github.com/jakebailey/dts-emit-widened-unwidened-examples

Just to summarize @weswigham, this is arguably a limitation of declaration emit, and we could alternatively fix this by introducing syntax into d.ts emit that emulates ternaries, destructuring, ??, etc, which all have this problem. This is the method we currently take via emitting initializers (and why this PR skips those as they are already handled). Fixing it in declaration emit is somewhat preferable because it doesn't shift this problem off to users.

@fatcerberus
Copy link

Just guessing based on the title of this PR, but is #55832 related? (it's a case where declaration emit produces a different type--in particular any (!)--than what's inferred locally)

@jakebailey jakebailey changed the title Try emitting an error when export would be emitted as initializer with different unwidened type Try emitting an error when export would be emitted with different unwidened type Sep 28, 2023
@jakebailey
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 28, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 9d8809c. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/157988/artifacts?artifactName=tgz&fileId=263604FABFD83844BD25D477B74EBDC2E51DFFB0394457DAB0C468948ABFAF1702&fileName=/typescript-5.3.0-insiders.20230928.tgz"
    }
}

and then running npm install.

@jakebailey
Copy link
Member Author

Just guessing based on the title of this PR, but is #55832 related? (it's a case where declaration emit produces a different type--in particular any (!)--than what's inferred locally)

In a way, yes, it's similar to this and #55901.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants