Skip to content
Unverified Commit e394ad8b authored by Fahad Zubair's avatar Fahad Zubair Committed by GitHub
Browse files

Fix `TSApplicationGenerator` to use `Result<>` instead of `#{Result}` (#4031)

The [earlier PR](https://github.com/smithy-lang/smithy-rs/pull/4010

),
which ensured that a Smithy shape named `Result` does not conflict with
the Rust type `Result`, had a bug in `TSApplicationGenerator`. The
`rustTemplateBlock` was using `#{Result}` but `preludeScope` was not
passed in as a parameter.

This bug can be addressed in two ways:

1. Pass `*RuntimeType.preludeScope` to the `rustBlockTemplate` call
2. Remove `#{Result}` from `rustBlockTemplate` and continue using
`Result<>`

This PR implements the second approach because:

1. `TSApplicationGenerator` is slated for deprecation
2. The CI step `CI / PR Bot / Generate diff and upload to S3
(pull_request)` currently fails when comparing codegen between HEAD and
this version. Removing `#{Result}` is the most reliable way to avoid
parameter-passing issues with `rustBlockTemplate`

Co-authored-by: default avatarFahad Zubair <fahadzub@amazon.com>
parent bb92aefc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment