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(core): compile core cleanly with TypeScript 2.4 #18457

Closed
wants to merge 1 commit into from

Conversation

chuckjaz
Copy link
Contributor

@chuckjaz chuckjaz commented Aug 1, 2017

Fixes: #17863

PR Type

What kind of change does this PR introduce?

[x] Bugfix

What is the current behavior?

The core package does not compile cleanly with TypeScript 2.4.

Issue Number: #17863, #18454

What is the new behavior?

The core package compiles cleanly with TypeScript 2.4.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@mary-poppins
Copy link

You can preview 600e8ab at https://pr18457-600e8ab.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 62ad432 at https://pr18457-62ad432.ngbuilds.io/.

@@ -63,8 +63,9 @@ export interface IterableChanges<V> {
* of the item, after applying the operations up to this point.
*/
forEachOperation(
fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void):
void;
fn:
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a breaking change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This it is more accurate typing on what the code will actually do. This might introduce a new compiler error but it will point out real problems in the code.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

the rest looks good.

@@ -513,7 +513,7 @@ export interface IterableChanges<V> {
forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void): void;
forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

how can the currentIndex be null? that doesn't look right.

Choose a reason for hiding this comment

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

Do you mean that it should never be null? Because apparently (see #17863 (comment)) the compiler sometimes assumes that it may be null?
I.e. do you mean that there is a bug on the calling side(s), that should be fixed instead of the API as proposed here?

@chuckjaz
Copy link
Contributor Author

chuckjaz commented Aug 29, 2017

Obsolete. The deprecated default iterable differ was removed.

@chuckjaz chuckjaz closed this Aug 29, 2017
@mmc41
Copy link

mmc41 commented Sep 2, 2017

@chuckjaz I am very eager to get this problem fixed in a patch release to 4.x... Will this happen now that the PR is closed ?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@angular/core is not compatible with Typescript 2.4.1 when activating option strictNullChecks
7 participants