-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(python): correctly handle interface declarations on returned obje…
…cts (#980) When the returned type had a known base type, the interfaces tagged on the object reference tag. This addresses this problem.
- Loading branch information
1 parent
948000d
commit c2de100
Showing
18 changed files
with
608 additions
and
22 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
23 changes: 23 additions & 0 deletions
23
...mazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseJsii976.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,23 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseJsii976), fullyQualifiedName: "jsii-calc.BaseJsii976")] | ||
public class BaseJsii976 : DeputyBase | ||
{ | ||
public BaseJsii976(): base(new DeputyProps(new object[]{})) | ||
{ | ||
} | ||
|
||
protected BaseJsii976(ByRefValue reference): base(reference) | ||
{ | ||
} | ||
|
||
protected BaseJsii976(DeputyProps props): base(props) | ||
{ | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...on.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnJsii976.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,21 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <summary>Returns a subclass of a known class which implements an interface.</summary> | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiInterface(nativeType: typeof(IReturnJsii976), fullyQualifiedName: "jsii-calc.IReturnJsii976")] | ||
public interface IReturnJsii976 | ||
{ | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] | ||
double Foo | ||
{ | ||
get; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...II.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnJsii976Proxy.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,25 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <summary>Returns a subclass of a known class which implements an interface.</summary> | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiTypeProxy(nativeType: typeof(IReturnJsii976), fullyQualifiedName: "jsii-calc.IReturnJsii976")] | ||
internal sealed class IReturnJsii976Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IReturnJsii976 | ||
{ | ||
private IReturnJsii976Proxy(ByRefValue reference): base(reference) | ||
{ | ||
} | ||
|
||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiProperty(name: "foo", typeJson: "{\"primitive\":\"number\"}")] | ||
public double Foo | ||
{ | ||
get => GetInstanceProperty<double>(); | ||
} | ||
} | ||
} |
Oops, something went wrong.