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(dotnet): allow down-casting to parent interface type #983

Merged
merged 4 commits into from
Nov 13, 2019

Conversation

RomainMuller
Copy link
Contributor

Cast controls were too strict and prevented the framework from
successfully down-casting an object reference to a parent interface of
it's declared type; causing a cast error.

The new code looks for class compatibility using the standard .NET
primitives and successfully performs the requested cast.

Fixes #982


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

Cast controls were too strict and prevented the framework from
successfully down-casting an object reference to a parent interface of
it's declared type; causing a cast error.

The new code looks for class compatibility using the standard .NET
primitives and successfully performs the requested cast.

Fixes #982
@RomainMuller RomainMuller requested review from bmaizels and a team as code owners November 13, 2019 10:06
@mergify
Copy link
Contributor

mergify bot commented Nov 13, 2019

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

what about python?

Comment on lines +22 to +24
<ItemGroup>
<ProjectReference Include="..\..\..\jsii-dotnet-runtime\src\Amazon.JSII.Runtime\Amazon.JSII.Runtime.csproj" />
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this coming from and how come it wasn't required so far?

Copy link
Contributor Author

@RomainMuller RomainMuller Nov 13, 2019

Choose a reason for hiding this comment

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

So. I've added this because it makes working with the integration tests in an IDE much nicer... It isn't required per se, but ensures that the local source is used instead of what's in the symbols package (makes debugging more efficient, reduces cycle time because a single solution build gets all the work done, ...).

I routinely add this when I work in the kernel, and since this is not a published artifact, I figured I'd leave it in this time... Because it'd help everyone in this situation.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@RomainMuller
Copy link
Contributor Author

Added the mighty Python test (I swear that was always the plan, but I knew this was not a problem there, and I had to turn to other problems for a moment :D)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

#cringe
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@RomainMuller RomainMuller removed the request for review from bmaizels November 13, 2019 10:50
@RomainMuller RomainMuller merged commit 8a390e5 into master Nov 13, 2019
@RomainMuller RomainMuller deleted the rmuller/fix/982 branch November 13, 2019 10:51
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.

.NET won't cast to parent interface type
3 participants