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

fix(22682): Fail on class declaration in statement position for ES2015 or higher #47216

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicdard
Copy link
Contributor

@nicdard nicdard commented Dec 22, 2021

Fixes #22682

The error should be reported only in ES2015 or higher, therefore I changed the binder instead of the parser which needs still to parse this sequence to allow older standards.

In this PR I am checking only class declarations, since I am not sure from the conversation in the issue which is the required behaviour for enums.

Since this is my first contribution, I am not sure about the test coverage. In particular, I am not sure on how to generate the .error.txt file which I need to generate by running directly (calling tsc) the updated version of the compiler against the newly created scopeClassDeclaration.ts test file.

@ghost
Copy link

ghost commented Dec 22, 2021

CLA assistant check
All CLA requirements met.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 22, 2021
@@ -42870,6 +42870,9 @@ namespace ts {
}

function checkGrammarClassLikeDeclaration(node: ClassLikeDeclaration): boolean {
if (languageVersion >= ScriptTarget.ES2015 && node.parent && isIfStatement(node.parent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to gate this on the target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some more guidance? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should simply check always?

@nicdard
Copy link
Contributor Author

nicdard commented Mar 2, 2022

Hi I am sorry for the long time, I had examination session and some other stuff which took priority unfortunately :(

I will start working back on this tomorrow, thanks also a lot for the review!

@sandersn
Copy link
Member

Do you want to keep working on this? Otherwise I'd like to close it to reduce the number of open PRs.

@nicdard
Copy link
Contributor Author

nicdard commented Mar 31, 2022

Do you want to keep working on this? Otherwise I'd like to close it to reduce the number of open PRs.

Yes sure I'd like to try to solve the issue:) however I didn't fully understand the feedback, especially the first one, can you provide more guidance?

@nicdard nicdard force-pushed the fix/error-for-class-declaration-in-statement branch 4 times, most recently from 97beb77 to 87ac77b Compare April 1, 2022 00:30
@nicdard
Copy link
Contributor Author

nicdard commented Apr 1, 2022

@DanielRosenwasser I think I addressed all the issues you mentioned in your review (thanks again), still not entirely sure on the first suggestion, but in case let me know so I will fix it :)

@nicdard nicdard force-pushed the fix/error-for-class-declaration-in-statement branch from 87ac77b to b0f56dd Compare April 3, 2022 10:15
@jakebailey
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 4, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 4, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 4, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 4, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey
Great news! no new errors were found between main..refs/pull/47216/merge

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to hit the request changes button. See above for comments.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..47216

Metric main 47216 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 356,679k (± 0.01%) 356,629k (± 0.04%) -50k (- 0.01%) 356,235k 356,913k
Parse Time 2.06s (± 0.31%) 2.06s (± 0.66%) 0.00s ( 0.00%) 2.03s 2.09s
Bind Time 0.86s (± 0.72%) 0.86s (± 1.02%) +0.00s (+ 0.47%) 0.85s 0.89s
Check Time 5.79s (± 0.44%) 5.80s (± 0.46%) +0.01s (+ 0.19%) 5.75s 5.86s
Emit Time 5.96s (± 0.61%) 5.99s (± 0.76%) +0.04s (+ 0.62%) 5.94s 6.14s
Total Time 14.67s (± 0.38%) 14.71s (± 0.48%) +0.05s (+ 0.33%) 14.61s 14.96s
Compiler-Unions - node (v10.16.3, x64)
Memory used 205,811k (± 0.01%) 205,780k (± 0.04%) -31k (- 0.01%) 205,634k 205,935k
Parse Time 0.85s (± 0.40%) 0.84s (± 0.59%) -0.00s (- 0.24%) 0.84s 0.86s
Bind Time 0.52s (± 2.14%) 0.51s (± 1.02%) -0.01s (- 1.16%) 0.50s 0.52s
Check Time 7.93s (± 0.45%) 7.93s (± 0.43%) +0.00s (+ 0.06%) 7.87s 8.00s
Emit Time 2.48s (± 1.00%) 2.50s (± 0.91%) +0.02s (+ 0.77%) 2.44s 2.55s
Total Time 11.77s (± 0.40%) 11.79s (± 0.45%) +0.02s (+ 0.17%) 11.69s 11.91s
Monaco - node (v10.16.3, x64)
Memory used 343,636k (± 0.02%) 343,646k (± 0.02%) +10k (+ 0.00%) 343,479k 343,739k
Parse Time 1.57s (± 0.52%) 1.58s (± 0.73%) +0.01s (+ 0.83%) 1.56s 1.62s
Bind Time 0.75s (± 0.45%) 0.75s (± 0.45%) 0.00s ( 0.00%) 0.75s 0.76s
Check Time 5.74s (± 0.32%) 5.77s (± 0.59%) +0.04s (+ 0.61%) 5.69s 5.84s
Emit Time 3.23s (± 0.51%) 3.24s (± 0.74%) +0.01s (+ 0.31%) 3.19s 3.29s
Total Time 11.29s (± 0.25%) 11.35s (± 0.37%) +0.06s (+ 0.54%) 11.25s 11.45s
TFS - node (v10.16.3, x64)
Memory used 305,304k (± 0.02%) 305,259k (± 0.02%) -45k (- 0.01%) 305,034k 305,375k
Parse Time 1.28s (± 0.66%) 1.28s (± 0.55%) 0.00s ( 0.00%) 1.27s 1.30s
Bind Time 0.71s (± 0.51%) 0.72s (± 0.90%) +0.01s (+ 1.12%) 0.71s 0.73s
Check Time 5.24s (± 0.66%) 5.26s (± 0.71%) +0.02s (+ 0.32%) 5.17s 5.32s
Emit Time 3.45s (± 1.22%) 3.42s (± 1.12%) -0.02s (- 0.67%) 3.31s 3.50s
Total Time 10.69s (± 0.46%) 10.69s (± 0.46%) +0.00s (+ 0.04%) 10.58s 10.79s
material-ui - node (v10.16.3, x64)
Memory used 469,851k (± 0.01%) 469,837k (± 0.01%) -14k (- 0.00%) 469,716k 469,943k
Parse Time 1.82s (± 0.36%) 1.82s (± 0.45%) -0.00s (- 0.06%) 1.80s 1.84s
Bind Time 0.68s (± 0.91%) 0.68s (± 0.70%) -0.00s (- 0.29%) 0.67s 0.69s
Check Time 14.30s (± 0.64%) 14.33s (± 0.63%) +0.03s (+ 0.17%) 14.15s 14.51s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.79s (± 0.53%) 16.82s (± 0.57%) +0.03s (+ 0.15%) 16.63s 17.02s
xstate - node (v10.16.3, x64)
Memory used 574,047k (± 1.25%) 570,820k (± 0.02%) -3,227k (- 0.56%) 570,465k 571,045k
Parse Time 2.58s (± 0.46%) 2.58s (± 0.27%) +0.00s (+ 0.04%) 2.56s 2.59s
Bind Time 1.00s (± 0.47%) 1.01s (± 0.57%) +0.01s (+ 0.70%) 1.00s 1.02s
Check Time 1.52s (± 0.37%) 1.52s (± 0.73%) +0.01s (+ 0.46%) 1.51s 1.56s
Emit Time 0.07s (± 3.14%) 0.07s (± 0.00%) -0.00s (- 1.41%) 0.07s 0.07s
Total Time 5.16s (± 0.23%) 5.18s (± 0.21%) +0.02s (+ 0.41%) 5.17s 5.22s
Angular - node (v12.1.0, x64)
Memory used 334,453k (± 0.02%) 334,525k (± 0.02%) +72k (+ 0.02%) 334,355k 334,659k
Parse Time 2.04s (± 0.61%) 2.06s (± 0.77%) +0.02s (+ 0.98%) 2.02s 2.09s
Bind Time 0.82s (± 0.83%) 0.83s (± 0.96%) +0.01s (+ 0.97%) 0.82s 0.86s
Check Time 5.64s (± 1.02%) 5.63s (± 0.38%) -0.01s (- 0.14%) 5.59s 5.70s
Emit Time 6.25s (± 1.34%) 6.25s (± 0.70%) +0.00s (+ 0.02%) 6.18s 6.37s
Total Time 14.76s (± 0.60%) 14.78s (± 0.39%) +0.02s (+ 0.12%) 14.66s 14.92s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,196k (± 0.14%) 193,127k (± 0.16%) -69k (- 0.04%) 192,388k 193,575k
Parse Time 0.84s (± 1.01%) 0.85s (± 1.31%) +0.01s (+ 0.83%) 0.83s 0.88s
Bind Time 0.53s (± 1.32%) 0.54s (± 0.92%) +0.01s (+ 0.94%) 0.53s 0.55s
Check Time 7.42s (± 0.50%) 7.44s (± 0.37%) +0.02s (+ 0.23%) 7.38s 7.51s
Emit Time 2.51s (± 0.91%) 2.55s (± 1.60%) +0.04s (+ 1.63%) 2.49s 2.67s
Total Time 11.31s (± 0.49%) 11.37s (± 0.33%) +0.07s (+ 0.58%) 11.31s 11.48s
Monaco - node (v12.1.0, x64)
Memory used 326,546k (± 0.06%) 326,591k (± 0.04%) +45k (+ 0.01%) 326,057k 326,772k
Parse Time 1.54s (± 0.84%) 1.56s (± 0.56%) +0.02s (+ 1.23%) 1.54s 1.58s
Bind Time 0.74s (± 1.35%) 0.74s (± 0.92%) +0.00s (+ 0.13%) 0.73s 0.76s
Check Time 5.60s (± 0.40%) 5.61s (± 0.55%) +0.01s (+ 0.12%) 5.56s 5.71s
Emit Time 3.26s (± 0.60%) 3.26s (± 0.83%) +0.01s (+ 0.25%) 3.20s 3.32s
Total Time 11.14s (± 0.26%) 11.18s (± 0.48%) +0.03s (+ 0.30%) 11.10s 11.31s
TFS - node (v12.1.0, x64)
Memory used 289,926k (± 0.06%) 289,995k (± 0.02%) +68k (+ 0.02%) 289,836k 290,148k
Parse Time 1.29s (± 1.12%) 1.29s (± 0.77%) -0.00s (- 0.08%) 1.27s 1.32s
Bind Time 0.71s (± 1.28%) 0.71s (± 2.34%) +0.00s (+ 0.42%) 0.69s 0.77s
Check Time 5.16s (± 0.31%) 5.22s (± 0.64%) +0.06s (+ 1.14%) 5.17s 5.30s
Emit Time 3.46s (± 1.01%) 3.46s (± 1.00%) -0.00s (- 0.12%) 3.37s 3.53s
Total Time 10.62s (± 0.42%) 10.68s (± 0.56%) +0.06s (+ 0.55%) 10.57s 10.81s
material-ui - node (v12.1.0, x64)
Memory used 448,913k (± 0.01%) 448,783k (± 0.05%) -130k (- 0.03%) 447,832k 448,979k
Parse Time 1.81s (± 0.66%) 1.81s (± 0.56%) +0.00s (+ 0.22%) 1.79s 1.83s
Bind Time 0.64s (± 0.56%) 0.65s (± 0.80%) +0.01s (+ 1.09%) 0.64s 0.66s
Check Time 12.82s (± 0.35%) 12.95s (± 0.60%) +0.12s (+ 0.95%) 12.83s 13.18s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.28s (± 0.29%) 15.41s (± 0.55%) +0.13s (+ 0.84%) 15.27s 15.65s
xstate - node (v12.1.0, x64)
Memory used 536,447k (± 0.02%) 539,580k (± 1.31%) +3,133k (+ 0.58%) 536,242k 568,181k
Parse Time 2.51s (± 0.49%) 2.53s (± 0.64%) +0.02s (+ 0.68%) 2.49s 2.57s
Bind Time 1.03s (± 0.43%) 1.04s (± 0.81%) +0.01s (+ 0.68%) 1.02s 1.05s
Check Time 1.46s (± 0.30%) 1.47s (± 0.25%) +0.00s (+ 0.27%) 1.46s 1.47s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.08s (± 0.19%) 5.10s (± 0.44%) +0.02s (+ 0.47%) 5.06s 5.16s
Angular - node (v14.15.1, x64)
Memory used 332,803k (± 0.01%) 332,812k (± 0.01%) +9k (+ 0.00%) 332,765k 332,861k
Parse Time 2.01s (± 0.53%) 2.02s (± 0.52%) +0.01s (+ 0.65%) 2.00s 2.04s
Bind Time 0.87s (± 0.60%) 0.87s (± 0.51%) +0.00s (+ 0.35%) 0.86s 0.88s
Check Time 5.60s (± 0.41%) 5.62s (± 0.51%) +0.02s (+ 0.32%) 5.57s 5.71s
Emit Time 6.26s (± 0.48%) 6.31s (± 0.51%) +0.05s (+ 0.75%) 6.25s 6.37s
Total Time 14.75s (± 0.21%) 14.82s (± 0.38%) +0.08s (+ 0.54%) 14.74s 14.96s
Compiler-Unions - node (v14.15.1, x64)
Memory used 194,020k (± 0.61%) 193,688k (± 0.62%) -331k (- 0.17%) 192,044k 195,353k
Parse Time 0.85s (± 0.40%) 0.86s (± 0.26%) +0.01s (+ 0.70%) 0.85s 0.86s
Bind Time 0.56s (± 0.61%) 0.56s (± 0.60%) +0.01s (+ 1.08%) 0.56s 0.57s
Check Time 7.49s (± 0.43%) 7.56s (± 0.93%) +0.07s (+ 0.99%) 7.46s 7.76s
Emit Time 2.50s (± 0.92%) 2.50s (± 0.61%) -0.00s (- 0.12%) 2.47s 2.53s
Total Time 11.40s (± 0.33%) 11.48s (± 0.74%) +0.08s (+ 0.72%) 11.35s 11.71s
Monaco - node (v14.15.1, x64)
Memory used 325,411k (± 0.01%) 325,403k (± 0.00%) -8k (- 0.00%) 325,363k 325,434k
Parse Time 1.58s (± 0.75%) 1.58s (± 0.60%) -0.00s (- 0.32%) 1.57s 1.61s
Bind Time 0.78s (± 0.75%) 0.78s (± 0.75%) +0.00s (+ 0.00%) 0.77s 0.79s
Check Time 5.49s (± 0.45%) 5.50s (± 0.29%) +0.01s (+ 0.13%) 5.46s 5.53s
Emit Time 3.30s (± 0.39%) 3.31s (± 0.93%) +0.02s (+ 0.52%) 3.25s 3.40s
Total Time 11.15s (± 0.33%) 11.17s (± 0.35%) +0.02s (+ 0.17%) 11.06s 11.27s
TFS - node (v14.15.1, x64)
Memory used 288,933k (± 0.01%) 288,916k (± 0.01%) -17k (- 0.01%) 288,815k 288,995k
Parse Time 1.31s (± 1.33%) 1.34s (± 3.22%) +0.03s (+ 2.52%) 1.28s 1.46s
Bind Time 0.75s (± 3.20%) 0.73s (± 0.93%) -0.01s (- 1.87%) 0.72s 0.75s
Check Time 5.14s (± 0.46%) 5.16s (± 0.42%) +0.03s (+ 0.51%) 5.10s 5.20s
Emit Time 3.54s (± 1.81%) 3.58s (± 1.48%) +0.04s (+ 1.04%) 3.44s 3.64s
Total Time 10.74s (± 0.77%) 10.82s (± 0.77%) +0.08s (+ 0.74%) 10.64s 11.00s
material-ui - node (v14.15.1, x64)
Memory used 447,046k (± 0.07%) 447,187k (± 0.06%) +141k (+ 0.03%) 446,124k 447,366k
Parse Time 1.86s (± 0.54%) 1.87s (± 0.48%) +0.01s (+ 0.48%) 1.85s 1.88s
Bind Time 0.70s (± 1.00%) 0.71s (± 0.47%) +0.01s (+ 1.57%) 0.70s 0.72s
Check Time 12.94s (± 0.58%) 13.12s (± 0.89%) +0.17s (+ 1.34%) 12.84s 13.33s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.50s (± 0.46%) 15.69s (± 0.79%) +0.19s (+ 1.23%) 15.41s 15.92s
xstate - node (v14.15.1, x64)
Memory used 534,125k (± 0.00%) 534,130k (± 0.00%) +5k (+ 0.00%) 534,086k 534,216k
Parse Time 2.57s (± 0.41%) 2.57s (± 0.37%) +0.01s (+ 0.31%) 2.56s 2.60s
Bind Time 1.14s (± 0.90%) 1.14s (± 0.70%) +0.00s (+ 0.26%) 1.13s 1.17s
Check Time 1.50s (± 0.41%) 1.51s (± 0.64%) +0.01s (+ 0.80%) 1.50s 1.53s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.28s (± 0.36%) 5.30s (± 0.41%) +0.02s (+ 0.42%) 5.27s 5.35s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory3 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 47216 10
Baseline main 10

Developer Information:

Download Benchmark

@nicdard nicdard force-pushed the fix/error-for-class-declaration-in-statement branch from b0f56dd to 8afc088 Compare April 6, 2022 21:04
@jakebailey
Copy link
Member

@typescript-bot user test this inline

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 6, 2022

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

@jakebailey
Copy link
Member

Hm, this fails quite a bit; I don't think you ran the tests before sending.

I think there's more things to check than just isBlock (there's module blocks, case blocks, or even the source file itself). There's a helper in extractSymbol called isBlockLike that would be a good candidate for moving into src/compiler/utilities.ts as it appears to do what's intended.

@nicdard
Copy link
Contributor Author

nicdard commented Apr 6, 2022

Hm, this fails quite a bit; I don't think you ran the tests before sending.

I think there's more things to check than just isBlock (there's module blocks, case blocks, or even the source file itself). There's a helper in extractSymbol called isBlockLike that would be a good candidate for moving into src/compiler/utilities.ts as it appears to do what's intended.

Yeah sorry for this, I was warning about in the thread:
mmm I am seeing this failing some compiler tests (sorry for this, my own computer is really to slow so I usually push to use the github infrastructure, I have tried the one test I modified but not the rest)

Oh cool thanks for the hint!

@nicdard
Copy link
Contributor Author

nicdard commented Apr 6, 2022

Hm, this fails quite a bit; I don't think you ran the tests before sending.

I think there's more things to check than just isBlock (there's module blocks, case blocks, or even the source file itself). There's a helper in extractSymbol called isBlockLike that would be a good candidate for moving into src/compiler/utilities.ts as it appears to do what's intended.

Actually I have taken a better look at the tests that are failing, and there are cases such:

/// anonClassDeclarationEmitsAnon.ts

// @declaration: true
// @filename: wrapClass.ts
export function wrapClass(param: any) {
    return class Wrapped {
        foo() {
            return param;
        }
    }
}

or

/// classExpressionWithStaticPropertiesES61.ts

//@target: es6
var v = class C { 
    static a = 1;
    static b = 2;
    static c = C.a + 3;
};

I think we should test first if the node is a class statement then, so we avoid all those errors on class expressions, am I on the right track?

@jakebailey
Copy link
Member

Clearly I was wrong about the rules, then. This code executes today: Playground Link

Probably worth testing all of the cases and see what's actually disallowed?

@nicdard
Copy link
Contributor Author

nicdard commented Apr 6, 2022

Clearly I was wrong about the rules, then. This code executes today: Playground Link

Probably worth testing all of the cases and see what's actually disallowed?

Maybe the intution was ok, but just regarding classDeclaration, I'll try, otherwise will go through all cases

@nicdard nicdard force-pushed the fix/error-for-class-declaration-in-statement branch from 8afc088 to 721a4b5 Compare April 6, 2022 23:42
Comment on lines 39279 to 39289
function isBlockLike(node: Node): node is BlockLike {
switch (node.kind) {
case SyntaxKind.Block:
case SyntaxKind.SourceFile:
case SyntaxKind.ModuleBlock:
case SyntaxKind.CaseClause:
return true;
default:
return false;
}
}
Copy link
Member

@jakebailey jakebailey Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably have been moved from extractSymbol.ts into src/compiler/utilities.ts rather than being copied and pasted here.

Copy link
Contributor Author

@nicdard nicdard Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was trying the tests, then fixing the PR, maybe I can change it to Draft while experimenting :) Sorry for this, it's just my computer really cannot run the tests without exploding 😅 Is there any tip to run them locally without overwhelming it?


while (class C {}) { // Not an error.
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should also test the other missing parents, e.g. case, default, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure thanks!

@nicdard
Copy link
Contributor Author

nicdard commented Apr 7, 2022

I'll change this to draft so I can work on it without disturbing, as soon as I think it is ready I will reopen it

@nicdard nicdard marked this pull request as draft April 7, 2022 00:29
@nicdard nicdard force-pushed the fix/error-for-class-declaration-in-statement branch from 721a4b5 to 24ba578 Compare April 7, 2022 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing error if ClassDeclaration is used in Statement position
6 participants