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

Unable to instantiate object when return type is abstract (.NET) #223

Closed
eladb opened this issue Sep 12, 2018 · 0 comments · Fixed by #257
Closed

Unable to instantiate object when return type is abstract (.NET) #223

eladb opened this issue Sep 12, 2018 · 0 comments · Fixed by #257

Comments

@eladb
Copy link
Contributor

eladb commented Sep 12, 2018

Clone of #220 for .NET

eladb pushed a commit that referenced this issue Sep 12, 2018
Generate a $proxy class for all abstract classes
and use them when the return type is abstract,
similar to interface proxies.

This change also adds "abstract: true" to all
interface members, so the proxy generator can
treat interfaces and classes polymorphically.

Added a compliance test "returnAbstract" which
verifies this behavior.

Fixes #220
Related to #223 (.NET)
Related to aws/aws-cdk#680 (require jsii update)
eladb pushed a commit that referenced this issue Sep 13, 2018
Generate a $proxy class for all abstract classes
and use them when the return type is abstract,
similar to interface proxies.

This change also adds "abstract: true" to all
interface members, so the proxy generator can
treat interfaces and classes polymorphically.

Added a compliance test "returnAbstract" which
verifies this behavior.

Fixes #220
Related to #223 (.NET)
Related to aws/aws-cdk#680 (require jsii update)
costleya added a commit to costleya/jsii that referenced this issue Sep 21, 2018
Abstract classes have can implementations that are not shared thorugh jsii. When trying to instantiate one for these types as a return value, the runtime crashes.
This change creates proxy class types for abstract classes. These types can be instantiated, and have implementations for any methods/properties marked as abstract.

Fixes aws#223
eladb pushed a commit that referenced this issue Sep 22, 2018
Abstract classes have can implementations that are not shared thorugh jsii. When trying to instantiate one for these types as a return value, the runtime crashes.
This change creates proxy class types for abstract classes. These types can be instantiated, and have implementations for any methods/properties marked as abstract.

Fixes #223

Add the ReturnsAbstract test to the complaince suite. This test ensures that proxy implementations are returned from methods that return a abstract class or interface.

* Add .DS_Store to .gitignore
* Rename JsiiInterfaceProxyAttribute to JsiiTypeProxy
* Proxy implementations are sealed
* Removed redundant checks for proxy resolution in runtime.
eladb pushed a commit that referenced this issue Oct 9, 2018
### Bug Fixes

* **dotnet:** abstract classes should have proxy implementations ([#241](#241)) ([828a26f](828a26f)), closes [#223](#223)
* **jsii:** better usage reporting of private types ([#247](#247)) ([96ac5d6](96ac5d6))
* **jsii-runtime:** Use buffer factory methods instead of constructor. ([#246](#246)) ([6ad6b9d](6ad6b9d))
* **kernel:** Return object literals as references ([#249](#249)) ([61cb3a4](61cb3a4)), closes [#248](#248) [aws/aws-cdk#774](aws/aws-cdk#774)
@eladb eladb mentioned this issue Oct 9, 2018
eladb pushed a commit that referenced this issue Oct 10, 2018
Bug Fixes
=========

* **dotnet:** abstract classes should have proxy implementations ([#241](#241)) ([828a26f](828a26f)), closes [#223](#223)
* **jsii:** better usage reporting of private types ([#247](#247)) ([96ac5d6](96ac5d6))
* **jsii:** support  public autoproperties in private constructor ([#256](#256)) ([181012e](181012e))
* **jsii:** use default jsx compiler options ([#260](#260)) ([660ae79](660ae79)), closes [aws/aws-cdk#830](aws/aws-cdk#830)
* **jsii-dotnet-generator:** Use FQ type returns in conflict. ([#258](#258)) ([a78784a](a78784a)), closes [#252](#252)
* **jsii-runtime:** Use buffer factory methods instead of constructor. ([#246](#246)) ([6ad6b9d](6ad6b9d))
* **kernel:** Return object literals as references ([#249](#249)) ([61cb3a4](61cb3a4)), closes [#248](#248) [aws/aws-cdk#774](aws/aws-cdk#774)

Misc
====

bump.sh was updated to let "lerna publish" automatically determine
the version number using conventional commits.
eladb pushed a commit that referenced this issue Oct 10, 2018
Bug Fixes
=========

* **dotnet:** abstract classes should have proxy implementations ([#241](#241)) ([828a26f](828a26f)), closes [#223](#223)
* **jsii:** better usage reporting of private types ([#247](#247)) ([96ac5d6](96ac5d6))
* **jsii:** support  public autoproperties in private constructor ([#256](#256)) ([181012e](181012e))
* **jsii:** use default jsx compiler options ([#260](#260)) ([660ae79](660ae79)), closes [aws/aws-cdk#830](aws/aws-cdk#830)
* **jsii-dotnet-generator:** Use FQ type returns in conflict. ([#258](#258)) ([a78784a](a78784a)), closes [#252](#252)
* **jsii-runtime:** Use buffer factory methods instead of constructor. ([#246](#246)) ([6ad6b9d](6ad6b9d))
* **kernel:** Return object literals as references ([#249](#249)) ([61cb3a4](61cb3a4)), closes [#248](#248) [aws/aws-cdk#774](aws/aws-cdk#774)

Misc
====

bump.sh was updated to let "lerna publish" automatically determine
the version number using conventional commits.
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 a pull request may close this issue.

1 participant