-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(runtime/dotnet): Correct a number of type mappings
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
- Loading branch information
1 parent
1b851e1
commit e15919b
Showing
24 changed files
with
309 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...kageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IDoublableProxy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace | ||
{ | ||
/// <summary>The general contract for a concrete number.</summary> | ||
[JsiiTypeProxy(typeof(IIDoublable), "@scope/jsii-calc-lib.IDoublable")] | ||
internal sealed class IDoublableProxy : DeputyBase, IIDoublable | ||
{ | ||
private IDoublableProxy(ByRefValue reference): base(reference) | ||
{ | ||
} | ||
|
||
[JsiiProperty("doubleValue", "{\"primitive\":\"number\"}")] | ||
public double DoubleValue | ||
{ | ||
get => GetInstanceProperty<double>(); | ||
} | ||
} | ||
} |
Oops, something went wrong.