Skip to content

[Python] Handle Dafny 4.11's escaping of reserved names #816

@robin-aws

Description

@robin-aws

Dafny made a good change to escape more reserved names (dafny-lang/dafny#6332), but this will break several test models and production libraries that use names like id and list. This showed up in the nightly builds recently: https://github.com/smithy-lang/smithy-dafny/actions/runs/17680475879/job/50253238310

The fix is likely to just update the corresponding list of reserved words here: https://github.com/smithy-lang/smithy-dafny/blob/main-1.x/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithypython/common/nameresolver/DafnyNameResolver.java#L38. The twist is to only do this if targeting a Dafny version on or after 4.11. This is already supported elsewhere though, such as https://github.com/smithy-lang/smithy-dafny/blob/main-1.x/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/nameresolver/Dafny.java#L147

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions