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

Move the initializer into the constructor for instance members that r… #6921

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

groszewn
Copy link
Contributor

…eference identifiers declared in the constructor.

This updates our OSS code with a change made in cl/678990911, to prevent the change being reverted the next time we sync into our internal code base.

When TypeScript outputs modern language features, the below case throws an TS error.

class C {
  a = this.x; // TS2729: Property 'x' is used before its initialization.

  constructor(public x:number){}
}

This error is fixed by moving the initializer of such class members into the constructor.

…eference identifiers declared in the constructor.

This updates our OSS code with a change made in cl/678990911, to prevent
the change being reverted the next time we sync into our internal code
base.

When TypeScript outputs modern language features, the below case throws an TS error.

```
class C {
  a = this.x; // TS2729: Property 'x' is used before its initialization.

  constructor(public x:number){}
}
```

This error is fixed by moving the initializer of such class members into
the constructor.
@groszewn groszewn merged commit dc20af5 into tensorflow:master Sep 26, 2024
13 checks passed
@groszewn groszewn deleted the sync branch September 26, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants