Skip to content

Debug Failure. Parameter symbol already has a cached type which differs from newly assigned type.Β #50773

Closed
@albertodvc

Description

@albertodvc

Bug Report

πŸ”Ž Search Terms

Error: Debug Failure. Expected [object Object] === [object Object]. Parameter symbol already has a cached type which differs from newly assigned type

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 4.6.4 and 4.7.2
  • This is still happening with the currently latest 4.8.3

⏯ Playground Link

Can't reproduce in the playgorund. To reproduce, run:

tsc code.js --allowJs --noEmit --target esnext.

πŸ’» Code

code.js

class Model {
  save() {
    return this.createMissingLabels()
      .then(() => this.$store.save(this));
  }

  createMissingLabels() {
    if (this.labels && Array.isArray(this.labels)) {
      return Promise.all(this.labels.map(
        label => this.$store.createLabel(label)
      )).then(labels => (this.labels = labels));
    }
    return Promise.resolve();
  }
}

πŸ™ Actual behavior

Debug Failure. Expected [object Object] === [object Object]. Parameter symbol already has a cached type which differs from newly assigned type

πŸ™‚ Expected behavior

No crash

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions