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(jsii): unknown error in Assembler._validateHeritageClauses #2350

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

RomainMuller
Copy link
Contributor

When the source code does not compile due to type checking errors, the
TypeScript program model may include "error type" placeholders, to allow
the compiler to provide feedback on subsequent code. The placeholder
types do not have a symbol (quite intentionally!), and will hence cause
a failure in the Assembler.validateHeritageClauses method.

This change makes the code more defensive so it does not crash on this
symptom, and does not report an additional error either (the TypeScript
compiler will have done this for us already).

The bug is more likely to hit users operating under --watch, as the
type checker is more likely to be able to insert placeholder types in
this case, as a previous version of the program might be used as a
crutch to understand the error's context... This makes this bug
difficult to reproduce in lab conditions, and is why this change does
not include a corresponding unit test.

Fixes #2349


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When the source code does not compile due to type checking errors, the
TypeScript program model may include "error type" placeholders, to allow
the compiler to provide feedback on subsequent code. The placeholder
types do not have a symbol (quite intentionally!), and will hence cause
a failure in the `Assembler.validateHeritageClauses` method.

This change makes the code more defensive so it does not crash on this
symptom, and does not report an additional error either (the TypeScript
compiler will have done this for us already).

The bug is more likely to hit users operating under `--watch`, as the
type checker is more likely to be able to insert placeholder types in
this case, as a previous version of the program might be used as a
crutch to understand the error's context... This makes this bug
difficult to reproduce in lab conditions, and is why this change does
not include a corresponding unit test.

Fixes #2349
@RomainMuller RomainMuller requested a review from a team December 14, 2020 14:43
@RomainMuller RomainMuller self-assigned this Dec 14, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 14, 2020
@mergify
Copy link
Contributor

mergify bot commented Dec 14, 2020

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Dec 14, 2020
@mergify
Copy link
Contributor

mergify bot commented Dec 14, 2020

Merging (with squash)...

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-5lHf64IXfvmr
  • Commit ID: bb4c1cd
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 3120bf4 into main Dec 14, 2020
@mergify mergify bot deleted the rmuller/validate-heritage-clauses branch December 14, 2020 17:16
@mergify
Copy link
Contributor

mergify bot commented Dec 14, 2020

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown error: Cannot read property 'declarations' of undefined
3 participants