Given a signature like:
export interface MyProps {
fooBar: string;
}
export class MyClass {
public doAThing(fooBar: string, props: MyProps) {
}
}
That works fine in TypeScript, but in languages where we want to "lift" a final props parameter into arguments to the function itself (like for example, keyword arguments in Python), this will fail because it will generate code like:
class MyClass:
def do_a_thing(foo_bar: str, *, foo_bar):
...
Which is an error, because there is a collision on the "real" function parameter names, and the lifted parameter names, and you can't have two parameters with the same name.
Ideally the JSII compiler would reject this method signature, and require one of the two names to change. Alternatively, if there were a way to either opt-in or opt-out of the lifting of MyProps into keyword arguments, that could also allow people a way to resolve this without requiring them to choose different names, they would just not lift that particular data type into keyword arguments.