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

Unblock LSC - Patch 1 - Fix initializer of instance members that reference identifiers declared in the constructor #6900

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

rileyajones
Copy link
Contributor

Motivation for features / changes

There is an ongoing LSC cl/652971829 which changes how instance methods are set. The change is blocked because of our split codebase. This PR is intended as a replacement for go/tbpr/6882

frost-cy and others added 3 commits July 17, 2024 12:19
…ed in the constructor

When public class fields are enabled, such cases throw a TS error similar to this.

```
third_party/javascript/angular_components/src/cdk/platform/platform.ts:37:29 - error TS2729: Property '_platformId' is used before its initialization.

37   isBrowser: boolean = this._platformId
                               ~~~~~~~~~~~

  third_party/javascript/angular_components/src/cdk/platform/platform.ts:87:15
    87   constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '_platformId' is declared here.
```

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

This is a no-op change 

See go/lsc-fix-properties-used-before-initialization
@rileyajones rileyajones requested a review from arcra August 16, 2024 18:38
@rileyajones rileyajones changed the title Unblock LSC - Patch 1 Unblock LSC - Patch 1 - Fix initializer of instance members that reference identifiers declared in the constructor Aug 16, 2024
@rileyajones rileyajones merged commit b56c655 into tensorflow:master Aug 16, 2024
13 checks passed
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.

3 participants