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(@ngtools/webpack): fix error with object spread #4642

Merged
merged 1 commit into from
Feb 13, 2017

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Feb 13, 2017

The loader throws an exception when an object spread is used. This fixes it.

Fixes #4600

@hansl hansl requested a review from Brocco February 13, 2017 01:38
The loader throws an exception when an object spread is used. This fixes it.

Fixes angular#4600
@hansl hansl merged commit 8b3e300 into angular:master Feb 13, 2017
@WonderPanda
Copy link

When can we expect these changes to available in an NPM update?

@Emnalyeriar
Copy link

Emnalyeriar commented Mar 3, 2017

Is this implemented in RC.1? It doesn't work for me
Example:

    case userActions.ActionTypes.DELETE_USER: {
      return {
        ...initialState
      }
    }

Error:

Type '{ initialState: State; }' is not assignable to type 'State'.
  Object literal may only specify known properties, and 'initialState' does not exist in type 'State'.)

Here is the code running correctly in Typescript playground:
http://www.typescriptlang.org/play/#src=interface%20State%20%7B%0D%0A%20%20%20%20name%3A%20string%0D%0A%7D%3B%0D%0A%0D%0Aconst%20initialState%3A%20State%20%3D%20%7B%0D%0A%20%20%20%20name%3A%20'test'%0D%0A%7D%3B%0D%0A%0D%0Afunction%20reducer()%3A%20State%20%7B%0D%0A%20%20%20%20return%20%7B%0D%0A%20%20%20%20%20%20%20%20...initialState%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aconsole.log(reducer())%3B

@oskarstrasburger
Copy link

+1

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
The loader throws an exception when an object spread is used. This fixes it.

Fixes angular#4600
@hansl hansl deleted the ts21-loader branch August 2, 2018 19:59
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object spread results in 'Cannot read property 'kind' of undefined' error.
6 participants