Skip to content
New issue

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

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

Already on GitHub? # to your account

Report implicit any error for 'yield' result with no contextual type #41348

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

rbuckton
Copy link
Member

Adds an "implicit any" error when the result of a yield expression is used and that expression is untyped. For example:

function* g1() {
  const value = yield 1; // report implicit any error
}
function* g2() {
  yield 1; // result is unused, no error
}
function* g3() {
  const value: string = yield 1; // result is contextually typed by type annotation of `value`, no error.
}
function* g3(): Generator<number, void, string> {
  const value = yield 1; // result is contextually typed by return-type annotation of `g3`, no error.
}

Fixes #35105

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 31, 2020
@DanielRosenwasser DanielRosenwasser added the Breaking Change Would introduce errors in existing code label Nov 3, 2020
@rbuckton
Copy link
Member Author

rbuckton commented Nov 5, 2020

@typescript-bot perf test
@typescript-bot run dt
@typescript-bot test this
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 5, 2020

Heya @rbuckton, I've started to run the parallelized Definitely Typed test suite on this PR at 074d19b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 5, 2020

Heya @rbuckton, I've started to run the perf test suite on this PR at 074d19b. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 5, 2020

Heya @rbuckton, I've started to run the extended test suite on this PR at 074d19b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 5, 2020

Heya @rbuckton, I've started to run the parallelized community code test suite on this PR at 074d19b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..41348

Metric master 41348 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,622k (± 0.01%) 344,642k (± 0.01%) +20k (+ 0.01%) 344,574k 344,738k
Parse Time 1.99s (± 0.48%) 1.98s (± 0.66%) -0.01s (- 0.65%) 1.96s 2.00s
Bind Time 0.83s (± 1.07%) 0.83s (± 0.54%) -0.00s (- 0.24%) 0.82s 0.84s
Check Time 4.98s (± 0.44%) 4.96s (± 0.66%) -0.02s (- 0.44%) 4.90s 5.04s
Emit Time 5.34s (± 0.81%) 5.33s (± 0.48%) -0.01s (- 0.17%) 5.29s 5.40s
Total Time 13.15s (± 0.49%) 13.10s (± 0.42%) -0.05s (- 0.36%) 13.02s 13.26s
Monaco - node (v10.16.3, x64)
Memory used 354,630k (± 0.02%) 354,698k (± 0.01%) +68k (+ 0.02%) 354,583k 354,824k
Parse Time 1.61s (± 0.58%) 1.60s (± 0.56%) -0.01s (- 0.56%) 1.59s 1.63s
Bind Time 0.73s (± 0.88%) 0.73s (± 0.84%) -0.00s (- 0.14%) 0.72s 0.74s
Check Time 5.14s (± 0.63%) 5.15s (± 0.68%) +0.01s (+ 0.18%) 5.06s 5.23s
Emit Time 2.80s (± 1.18%) 2.82s (± 1.03%) +0.02s (+ 0.53%) 2.76s 2.88s
Total Time 10.29s (± 0.65%) 10.30s (± 0.55%) +0.02s (+ 0.16%) 10.18s 10.45s
TFS - node (v10.16.3, x64)
Memory used 307,930k (± 0.02%) 307,906k (± 0.01%) -24k (- 0.01%) 307,811k 307,970k
Parse Time 1.25s (± 0.40%) 1.23s (± 0.48%) -0.01s (- 0.88%) 1.22s 1.25s
Bind Time 0.69s (± 1.11%) 0.68s (± 0.59%) -0.00s (- 0.58%) 0.67s 0.69s
Check Time 4.57s (± 0.54%) 4.56s (± 0.31%) -0.02s (- 0.37%) 4.52s 4.58s
Emit Time 2.95s (± 0.79%) 2.94s (± 0.78%) -0.01s (- 0.41%) 2.88s 2.99s
Total Time 9.45s (± 0.40%) 9.41s (± 0.30%) -0.04s (- 0.44%) 9.32s 9.46s
material-ui - node (v10.16.3, x64)
Memory used 489,221k (± 0.01%) 489,227k (± 0.02%) +6k (+ 0.00%) 489,122k 489,493k
Parse Time 2.07s (± 0.49%) 2.06s (± 0.51%) -0.02s (- 0.82%) 2.03s 2.08s
Bind Time 0.66s (± 0.91%) 0.66s (± 0.75%) +0.00s (+ 0.00%) 0.65s 0.67s
Check Time 13.66s (± 0.95%) 13.54s (± 0.56%) -0.13s (- 0.94%) 13.39s 13.69s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.40s (± 0.86%) 16.25s (± 0.53%) -0.15s (- 0.92%) 16.08s 16.40s
Angular - node (v12.1.0, x64)
Memory used 322,311k (± 0.09%) 322,348k (± 0.09%) +37k (+ 0.01%) 321,171k 322,636k
Parse Time 1.98s (± 0.73%) 1.97s (± 0.59%) -0.01s (- 0.61%) 1.94s 1.99s
Bind Time 0.82s (± 0.73%) 0.81s (± 0.55%) -0.00s (- 0.37%) 0.80s 0.82s
Check Time 4.89s (± 0.79%) 4.90s (± 0.80%) +0.01s (+ 0.18%) 4.83s 5.00s
Emit Time 5.54s (± 0.80%) 5.52s (± 0.95%) -0.01s (- 0.27%) 5.45s 5.68s
Total Time 13.22s (± 0.57%) 13.20s (± 0.66%) -0.02s (- 0.15%) 13.08s 13.46s
Monaco - node (v12.1.0, x64)
Memory used 336,832k (± 0.02%) 336,847k (± 0.02%) +15k (+ 0.00%) 336,704k 337,024k
Parse Time 1.59s (± 0.46%) 1.58s (± 0.53%) -0.01s (- 0.44%) 1.56s 1.60s
Bind Time 0.71s (± 0.51%) 0.71s (± 0.99%) -0.00s (- 0.70%) 0.70s 0.72s
Check Time 4.92s (± 0.47%) 4.90s (± 0.45%) -0.02s (- 0.41%) 4.87s 4.95s
Emit Time 2.87s (± 0.76%) 2.87s (± 0.64%) -0.00s (- 0.10%) 2.82s 2.90s
Total Time 10.10s (± 0.28%) 10.06s (± 0.30%) -0.03s (- 0.34%) 9.99s 10.13s
TFS - node (v12.1.0, x64)
Memory used 292,160k (± 0.02%) 292,177k (± 0.02%) +17k (+ 0.01%) 292,008k 292,338k
Parse Time 1.26s (± 0.77%) 1.26s (± 0.82%) +0.00s (+ 0.24%) 1.24s 1.28s
Bind Time 0.65s (± 0.91%) 0.66s (± 0.75%) +0.00s (+ 0.31%) 0.65s 0.67s
Check Time 4.51s (± 0.70%) 4.49s (± 0.51%) -0.02s (- 0.51%) 4.43s 4.55s
Emit Time 2.96s (± 1.49%) 2.96s (± 1.23%) +0.00s (+ 0.07%) 2.88s 3.03s
Total Time 9.39s (± 0.59%) 9.38s (± 0.48%) -0.01s (- 0.14%) 9.32s 9.51s
material-ui - node (v12.1.0, x64)
Memory used 467,069k (± 0.08%) 467,320k (± 0.01%) +251k (+ 0.05%) 467,204k 467,485k
Parse Time 2.09s (± 0.53%) 2.09s (± 0.56%) 0.00s ( 0.00%) 2.06s 2.10s
Bind Time 0.65s (± 1.14%) 0.65s (± 1.12%) +0.00s (+ 0.31%) 0.63s 0.66s
Check Time 12.13s (± 0.83%) 12.07s (± 0.83%) -0.05s (- 0.45%) 11.87s 12.30s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.87s (± 0.68%) 14.81s (± 0.69%) -0.05s (- 0.35%) 14.63s 15.03s
Angular - node (v8.9.0, x64)
Memory used 347,122k (± 0.02%) 347,193k (± 0.02%) +71k (+ 0.02%) 347,015k 347,307k
Parse Time 2.53s (± 0.87%) 2.52s (± 0.37%) -0.02s (- 0.67%) 2.49s 2.54s
Bind Time 0.88s (± 0.59%) 0.87s (± 0.81%) -0.01s (- 1.14%) 0.85s 0.89s
Check Time 5.63s (± 0.42%) 5.60s (± 0.49%) -0.03s (- 0.59%) 5.52s 5.65s
Emit Time 6.29s (± 0.90%) 6.33s (± 0.95%) +0.04s (+ 0.65%) 6.16s 6.43s
Total Time 15.33s (± 0.43%) 15.32s (± 0.39%) -0.02s (- 0.13%) 15.15s 15.48s
Monaco - node (v8.9.0, x64)
Memory used 358,522k (± 0.02%) 358,541k (± 0.01%) +19k (+ 0.01%) 358,405k 358,618k
Parse Time 1.94s (± 0.53%) 1.93s (± 0.48%) -0.01s (- 0.46%) 1.91s 1.95s
Bind Time 0.92s (± 0.44%) 0.91s (± 0.83%) -0.01s (- 0.54%) 0.90s 0.93s
Check Time 5.69s (± 0.59%) 5.66s (± 0.59%) -0.03s (- 0.58%) 5.60s 5.73s
Emit Time 3.43s (± 0.63%) 3.42s (± 0.50%) -0.01s (- 0.26%) 3.38s 3.46s
Total Time 11.98s (± 0.33%) 11.92s (± 0.41%) -0.06s (- 0.47%) 11.84s 12.03s
TFS - node (v8.9.0, x64)
Memory used 310,427k (± 0.01%) 310,464k (± 0.02%) +37k (+ 0.01%) 310,382k 310,573k
Parse Time 1.57s (± 0.82%) 1.56s (± 0.37%) -0.01s (- 0.70%) 1.55s 1.58s
Bind Time 0.69s (± 0.43%) 0.69s (± 0.65%) -0.00s (- 0.58%) 0.68s 0.70s
Check Time 5.34s (± 0.65%) 5.31s (± 0.49%) -0.03s (- 0.58%) 5.27s 5.38s
Emit Time 2.99s (± 0.75%) 2.99s (± 0.45%) +0.01s (+ 0.17%) 2.96s 3.02s
Total Time 10.60s (± 0.54%) 10.56s (± 0.30%) -0.04s (- 0.42%) 10.49s 10.64s
material-ui - node (v8.9.0, x64)
Memory used 496,259k (± 0.01%) 496,263k (± 0.01%) +4k (+ 0.00%) 496,184k 496,310k
Parse Time 2.51s (± 0.48%) 2.49s (± 0.36%) -0.02s (- 0.96%) 2.47s 2.50s
Bind Time 0.80s (± 1.16%) 0.80s (± 1.08%) +0.00s (+ 0.00%) 0.79s 0.82s
Check Time 17.98s (± 0.75%) 18.03s (± 0.93%) +0.05s (+ 0.28%) 17.56s 18.29s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 21.29s (± 0.66%) 21.32s (± 0.77%) +0.03s (+ 0.14%) 20.87s 21.59s
Angular - node (v8.9.0, x86)
Memory used 199,064k (± 0.03%) 199,107k (± 0.02%) +43k (+ 0.02%) 198,982k 199,234k
Parse Time 2.44s (± 0.61%) 2.43s (± 0.82%) -0.01s (- 0.21%) 2.40s 2.48s
Bind Time 1.02s (± 0.93%) 1.02s (± 0.79%) -0.01s (- 0.59%) 1.00s 1.03s
Check Time 5.06s (± 0.69%) 5.06s (± 0.89%) -0.01s (- 0.12%) 4.98s 5.17s
Emit Time 6.11s (± 1.21%) 6.13s (± 0.79%) +0.02s (+ 0.28%) 6.04s 6.29s
Total Time 14.64s (± 0.61%) 14.64s (± 0.54%) +0.00s (+ 0.01%) 14.46s 14.89s
Monaco - node (v8.9.0, x86)
Memory used 203,055k (± 0.02%) 203,054k (± 0.02%) -1k (- 0.00%) 202,976k 203,173k
Parse Time 1.98s (± 1.16%) 1.98s (± 0.58%) -0.01s (- 0.35%) 1.96s 2.00s
Bind Time 0.72s (± 0.56%) 0.72s (± 0.95%) -0.00s (- 0.42%) 0.71s 0.74s
Check Time 5.76s (± 0.73%) 5.79s (± 0.53%) +0.03s (+ 0.56%) 5.73s 5.88s
Emit Time 2.76s (± 0.73%) 2.74s (± 0.72%) -0.01s (- 0.51%) 2.71s 2.81s
Total Time 11.22s (± 0.43%) 11.23s (± 0.43%) +0.01s (+ 0.10%) 11.14s 11.36s
TFS - node (v8.9.0, x86)
Memory used 177,533k (± 0.03%) 177,557k (± 0.03%) +24k (+ 0.01%) 177,431k 177,652k
Parse Time 1.63s (± 1.20%) 1.63s (± 1.08%) -0.00s (- 0.12%) 1.60s 1.67s
Bind Time 0.66s (± 1.05%) 0.65s (± 0.73%) -0.01s (- 1.22%) 0.64s 0.66s
Check Time 4.86s (± 0.83%) 4.86s (± 0.54%) +0.01s (+ 0.14%) 4.81s 4.91s
Emit Time 2.85s (± 0.93%) 2.83s (± 0.55%) -0.03s (- 0.95%) 2.80s 2.86s
Total Time 9.99s (± 0.73%) 9.96s (± 0.29%) -0.03s (- 0.28%) 9.92s 10.05s
material-ui - node (v8.9.0, x86)
Memory used 279,344k (± 0.02%) 279,294k (± 0.02%) -51k (- 0.02%) 279,208k 279,385k
Parse Time 2.56s (± 0.51%) 2.55s (± 0.78%) -0.00s (- 0.04%) 2.51s 2.60s
Bind Time 0.73s (± 4.41%) 0.78s (± 6.71%) +0.05s (+ 7.29%) 0.69s 0.86s
Check Time 16.48s (± 0.86%) 16.54s (± 0.76%) +0.06s (+ 0.37%) 16.27s 16.94s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 19.76s (± 0.62%) 19.87s (± 0.67%) +0.11s (+ 0.57%) 19.61s 20.21s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
Benchmark Name Iterations
Current 41348 10
Baseline master 10

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@rbuckton
Copy link
Member Author

@typescript-bot run dt
@typescript-bot test this
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @rbuckton, I've started to run the parallelized community code test suite on this PR at 074d19b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @rbuckton, I've started to run the extended test suite on this PR at 074d19b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @rbuckton, I've started to run the parallelized Definitely Typed test suite on this PR at 074d19b. You can monitor the build here.

@rbuckton
Copy link
Member Author

rbuckton commented Dec 18, 2020

rbuckton added a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Dec 18, 2020
This removes a test from `@wordpress/data-controls` that doesn't test anything useful and is broken by microsoft/TypeScript#41348 because all of the variables created are now considered "implicitly `any`".
orta pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Dec 18, 2020
This removes a test from `@wordpress/data-controls` that doesn't test anything useful and is broken by microsoft/TypeScript#41348 because all of the variables created are now considered "implicitly `any`".
@rbuckton rbuckton merged commit 4239904 into master Dec 18, 2020
@rbuckton rbuckton deleted the fix35105 branch December 18, 2020 17:55
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.2.0 milestone Jan 12, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Author: Team Breaking Change Would introduce errors in existing code For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

noImplicitAny ignores implicit any on yield expression assignment
4 participants