Add support for public properties defined in a private constructor#256
Merged
Add support for public properties defined in a private constructor#256
Conversation
This change is incomplete; the .NET generator doesn't know how to
deal with a private ("missing") constructor, so it throws a
NullReferenceException.
Contributor
Author
|
@costleya I'm going to need your help to land this. Constructors can be private, but I think the .NET generator has been written with the assumption that every class will always have a constructor, and so it errors out trying to access it: |
Contributor
Author
|
Feel free to append to this PR to make it pass. |
This was referenced Oct 9, 2018
Merged
Contributor
|
Can you please open two issues to add a conformance test in each language for this feature? public void classWithPrivateConstructorAndAutomaticProperties() {
ClassWithPrivateConstructorAndAutomaticProperties obj = new ClassWithPrivateConstructorAndAutomaticProperties();
obj.setReadWriteString("Hello");
assertEquals("<Some expected value>", obj.getReadOnlyString());
} |
eladb
approved these changes
Oct 9, 2018
Contributor
Author
|
@costleya hope it's not too much work, maybe a couple of |
Contributor
Contributor
|
@costleya 🤦♂️ |
Contributor
|
@costleya can you push your fixes so we can merge this in and release? |
Contributor
Author
|
On it |
eladb
pushed a commit
that referenced
this pull request
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 pull request
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is incomplete; the .NET generator doesn't know how to
deal with a private ("missing") constructor, so it throws a
NullReferenceException.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.