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

fix: require distinct argument and property names #272

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 22, 2018

Restrict the usage of datatype parameters in functions, so that
languages with keyword argument support can inline datatype parameters
into the function declaration. This means it cannot share any field
names with remaining function argument names.

Fixes #268.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Restrict the usage of datatype parameters in functions, so that
languages with keyword argument support can inline datatype parameters
into the function declaration. This means it cannot share any field
names with remaining function argument names.

Fixes #268.
@rix0rrr rix0rrr requested review from RomainMuller and eladb October 22, 2018 14:33
@rix0rrr rix0rrr merged commit 4d2f268 into master Oct 23, 2018
@rix0rrr rix0rrr deleted the huijbers/restrict-datatype-placement branch October 23, 2018 08:12
@eladb
Copy link
Contributor

eladb commented Oct 23, 2018

Can we also annotate the method in the jsii spec that keyword arguments can be expanded?

const lastParamTypeRef = apply(last(parameters), x => x.type);
const lastParamSymbol = last(signature.getParameters());
if (lastParamTypeRef && spec.isNamedTypeReference(lastParamTypeRef)) {
this._deferUntilTypesAvailable(symbol.name, [lastParamTypeRef], lastParamSymbol!.declarations[0], (lastParamType) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried about this programming model. I really liked your idea of phases as a safer and more deterministic alternative.

rix0rrr pushed a commit that referenced this pull request Oct 23, 2018
* **jsii:** use base interfaces for 'datatype' property ([#265](#265)) ([1c56902](1c56902)), closes [#264](#264)
* **jsii:** use default jsx compiler options ([#261](#261)) ([bf1f586](bf1f586)), closes [aws/aws-cdk#830](aws/aws-cdk#830)
* match behavioral interface to 'I'-prefix ([#271](#271)) ([03103f3](03103f3))
* require distinct argument and property names ([#272](#272)) ([4d2f268](4d2f268)), closes [#268](#268)
@rix0rrr rix0rrr mentioned this pull request Oct 23, 2018
rix0rrr added a commit that referenced this pull request Oct 23, 2018
Bug Fixes
=======

* **jsii:** use base interfaces for 'datatype' property ([#265](#265)) ([1c56902](1c56902)), closes [#264](#264)
* **jsii:** use default jsx compiler options ([#261](#261)) ([bf1f586](bf1f586)), closes [aws/aws-cdk#830](aws/aws-cdk#830)
* match behavioral interface to 'I'-prefix ([#271](#271)) ([03103f3](03103f3))
* require distinct argument and property names ([#272](#272)) ([4d2f268](4d2f268)), closes [#268](#268)
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 this pull request may close these issues.

3 participants