-
- Downloads
Fix recursive definition in SupportStructures.k (#4035)
This PR fixes a recursive definition issue in the `SupportStructures.kt`
file where `codegenScope` was being used within its own dependent
functions, creating a circular dependency. The issue specifically
occurred in the `serializeRedacted()`, `sensitive()`,
`configurableSerde()` and `serializeUnredacted()` functions where
`codegenScope` was being included in the template parameters.
The fix:
- Removed the recursive usage of `codegenScope`
- Instead, directly used `RuntimeType.preludeScope` where needed
- This change maintains the same functionality while avoiding the
circular dependency
Before:
```kotlin
*codegenScope // This created a recursive definition as codegenScope depends on these functions
```
After:
```kotlin
*RuntimeType.preludeScope // Direct usage of prelude scope without recursion
```
Co-authored-by:
Fahad Zubair <fahadzub@amazon.com>
Showing
- codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt 2 additions, 0 deletions...mazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt
- codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SupportStructures.kt 4 additions, 5 deletions...are/amazon/smithy/rust/codegen/serde/SupportStructures.kt
Loading
Please register or sign in to comment