Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Nov 28, 2025

For some unknown reason, when operating in a large repo like aws/aws-cdk, using the $this helper causes the type checker to fail and "ignore" the ExpressionProxy part of the type. This then causes a lot of type errors. Only happens in the IDE and is not consistent.

I tested a few things and changing the type of $this from ExpressionProxy<ThisInstance> to ExpressionProxy<Expression> seems to fix it. This is okay, because ThisInstance currently just extends Expression. And in any case the helper is intended to be used as a proxy, not as ThisInstance itself.

It's not really a satisfying solution, but a practical one.

@mrgrain mrgrain force-pushed the mrgrain/fix/typewriter/this-expression-type branch from a4ce8b0 to 84caf23 Compare November 28, 2025 18:54
@github-actions
Copy link
Contributor

@aws-cdk/aws-service-spec: No model change detected

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit 5c6a2ce Nov 28, 2025
10 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/fix/typewriter/this-expression-type branch November 28, 2025 20:21
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