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

Method Parameter Collision with Data Type property names not working for initializers #288

Closed
dstufft opened this issue Oct 30, 2018 · 0 comments
Labels
bug This issue is a bug. still-relevant? Checking to see if the issue is still relevant

Comments

@dstufft
Copy link
Contributor

dstufft commented Oct 30, 2018

It looks like the code added in #272 isn’t functioning in all cases. In particular, the Resource class in API Gateway has a constructor that is defined like:

constructor(parent: cdk.Construct, id: string, props: ResourceProps)

The ResourceProps interface is defined as:

export interface ResourceProps extends ResourceOptions {
  parent: IRestApiResource;
  pathPart: string;
}

Which means that when lifting the ResourceProps into keyword arguments, we’re attempting to generate a method signature like:

def __init__(self, parent: cdk.Construct, id: str, *, parent: IRestApiResource, pathPath: str) -> None

Which does not work, because there are two parameters named parent (which was the issue that #272 was looking to solve in the first place).

I’m guessing that because the original PR was touching only code inside of a _visitMethod method, that there is somewhere else this check needs to be added to handle initializer methods as well as regular methods— that’s just a guess though.

@SomayaB SomayaB added the bug This issue is a bug. label Nov 18, 2019
@SomayaB SomayaB added the still-relevant? Checking to see if the issue is still relevant label Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. still-relevant? Checking to see if the issue is still relevant
Projects
None yet
Development

No branches or pull requests

3 participants