-
Notifications
You must be signed in to change notification settings - Fork 245
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
.NET fails mapping objects to interface types when returned from callbacks #290
Labels
Comments
RomainMuller
added
bug
This issue is a bug.
language/dotnet
Related to .NET bindings (C#, F#, ...)
labels
Nov 2, 2018
RomainMuller
added a commit
that referenced
this issue
Nov 2, 2018
Use the type data available on the deputy object to determine the relevant JSII type for the result of callbacks, instead of trying to map into `PrimitiveType.Any`. Fixes #290 Fixes aws/aws-cdk#1027
RomainMuller
added a commit
that referenced
this issue
Nov 2, 2018
The `jsii` compiler incorrectly mapped types homonym with a standard type (`String`, `Number`, ...) to the primitive type on usage sites. This commit corrects this behavior and adjusts the C# tests accordingly. Additionally, when the return type of a callback was an interface, the C# runtime was unable to determine the correct JSII type to use, despite it has the information on the type of the callback method available. The resolution behavior has also been fixes, as well as a couple of other glitches that became apparent as a result of the `Number` type starting to be correctly represented as the `@scope/jsii-calc-lib.Number` type. Fixes #290 Fixes aws/aws-cdk#1027
RomainMuller
added a commit
that referenced
this issue
Nov 5, 2018
The `jsii` compiler incorrectly mapped types homonym with a standard type (`String`, `Number`, ...) to the primitive type on usage sites. This commit corrects this behavior and adjusts the C# tests accordingly. Additionally, when the return type of a callback was an interface, the C# runtime was unable to determine the correct JSII type to use, despite it has the information on the type of the callback method available. The resolution behavior has also been fixes, as well as a couple of other glitches that became apparent as a result of the `Number` type starting to be correctly represented as the `@scope/jsii-calc-lib.Number` type. Fixes #290 Fixes aws/aws-cdk#1027
RomainMuller
added a commit
that referenced
this issue
Nov 6, 2018
The `jsii` compiler incorrectly mapped types homonym with a standard type (`String`, `Number`, ...) to the primitive type on usage sites. This commit corrects this behavior and adjusts the C# tests accordingly. Additionally, when the return type of a callback was an interface, the C# runtime was unable to determine the correct JSII type to use, despite it has the information on the type of the callback method available. The resolution behavior has also been fixes, as well as a couple of other glitches that became apparent as a result of the `Number` type starting to be correctly represented as the `@scope/jsii-calc-lib.Number` type. Fixes #290 Fixes aws/aws-cdk#1027
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
When a method that is modeled to return an interface type is overridden in .NET, the callback handler fails to map the object to the JSII type, producing the
Could not infer JSII type for .NET type
error.This is because the callback code attempts to map the type using the
PrimitiveType.Any
reference type instead of what is modeled on the overridden function.This was identified as the root cause of aws/aws-cdk#1027.
The text was updated successfully, but these errors were encountered: