From 67e9448a6e133f6ecc1e40a6e394002c0ce8fdf7 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Thu, 15 Aug 2024 16:53:46 -0500 Subject: [PATCH] fix: Supply explicit type on forEach block to try preventing compiler crash (#1682) --- .../smithy/aws/swift/codegen/PresignerGeneratorTests.kt | 8 ++++---- .../swift/codegen/awsquery/AWSQueryOperationStackTest.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt index 6319d62b5f3..47a96400ade 100644 --- a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt +++ b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGeneratorTests.kt @@ -43,7 +43,7 @@ extension GetFooInput { config.interceptorProviders.forEach { provider in builder.interceptors.add(provider.create()) } - config.httpInterceptorProviders.forEach { provider in + config.httpInterceptorProviders.forEach { (provider: any ClientRuntime.HttpInterceptorProvider) -> Void in let i: any ClientRuntime.HttpInterceptor = provider.create() builder.interceptors.add(i) } @@ -111,7 +111,7 @@ extension PostFooInput { config.interceptorProviders.forEach { provider in builder.interceptors.add(provider.create()) } - config.httpInterceptorProviders.forEach { provider in + config.httpInterceptorProviders.forEach { (provider: any ClientRuntime.HttpInterceptorProvider) -> Void in let i: any ClientRuntime.HttpInterceptor = provider.create() builder.interceptors.add(i) } @@ -182,7 +182,7 @@ extension PutFooInput { config.interceptorProviders.forEach { provider in builder.interceptors.add(provider.create()) } - config.httpInterceptorProviders.forEach { provider in + config.httpInterceptorProviders.forEach { (provider: any ClientRuntime.HttpInterceptorProvider) -> Void in let i: any ClientRuntime.HttpInterceptor = provider.create() builder.interceptors.add(i) } @@ -253,7 +253,7 @@ extension PutObjectInput { config.interceptorProviders.forEach { provider in builder.interceptors.add(provider.create()) } - config.httpInterceptorProviders.forEach { provider in + config.httpInterceptorProviders.forEach { (provider: any ClientRuntime.HttpInterceptorProvider) -> Void in let i: any ClientRuntime.HttpInterceptor = provider.create() builder.interceptors.add(i) } diff --git a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/awsquery/AWSQueryOperationStackTest.kt b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/awsquery/AWSQueryOperationStackTest.kt index 3723fa1d516..71f1a00e99c 100644 --- a/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/awsquery/AWSQueryOperationStackTest.kt +++ b/codegen/smithy-aws-swift-codegen/src/test/kotlin/software/amazon/smithy/aws/swift/codegen/awsquery/AWSQueryOperationStackTest.kt @@ -25,7 +25,7 @@ class AWSQueryOperationStackTest { config.interceptorProviders.forEach { provider in builder.interceptors.add(provider.create()) } - config.httpInterceptorProviders.forEach { provider in + config.httpInterceptorProviders.forEach { (provider: any ClientRuntime.HttpInterceptorProvider) -> Void in let i: any ClientRuntime.HttpInterceptor = provider.create() builder.interceptors.add(i) }