-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Make models Sendable #1771
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9d1d10d
Empty commit
jbelkins 1385344
Fix tests
jbelkins 64455f9
Fix warnings on extended types
jbelkins 5dfc2a7
Swift 5 compatible 'retroactive conformance' suppression
jbelkins ee90d27
Merge branch 'main' into jbe/sendable_document_and_streams
jbelkins 9af8901
Merge branch 'main' into jbe/sendable_document_and_streams
jbelkins 6360423
Merge branch 'jbe/sendable_document_and_streams' of github.com:awslab…
jbelkins cc10c5f
Merge branch 'main' into jbe/sendable_document_and_streams
jbelkins c714770
xcode-select setup before CI
jbelkins db930ec
Fix xcode-select
jbelkins 3055865
Fix integration-test developer dir
jbelkins 58cff66
Fix matrix exclusions
jbelkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,22 +15,21 @@ class S3ExpiresTest { | |
val context = setupTests("s3-expires.smithy", "com.amazonaws.s3#S3", "S3") | ||
val contents = TestUtils.getFileContents(context.manifest, "Sources/Example/models/FooOutput.swift") | ||
contents.shouldSyntacticSanityCheck() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests fixed below, which were affected by the changes made in smithy-swift. |
||
val expectedContents = | ||
""" | ||
public struct FooOutput { | ||
public var expires: Swift.String? | ||
public var payload1: Swift.String? | ||
|
||
public init( | ||
expires: Swift.String? = nil, | ||
payload1: Swift.String? = nil | ||
) | ||
{ | ||
self.expires = expires | ||
self.payload1 = payload1 | ||
} | ||
} | ||
""".trimIndent() | ||
val expectedContents = """ | ||
public struct FooOutput: Swift.Sendable { | ||
public var expires: Swift.String? | ||
public var payload1: Swift.String? | ||
|
||
public init( | ||
expires: Swift.String? = nil, | ||
payload1: Swift.String? = nil | ||
) | ||
{ | ||
self.expires = expires | ||
self.payload1 = payload1 | ||
} | ||
} | ||
""" | ||
contents.shouldContainOnlyOnce(expectedContents) | ||
} | ||
|
||
|
@@ -39,22 +38,21 @@ class S3ExpiresTest { | |
val context = setupTests("s3-expires.smithy", "com.amazonaws.s3#S3", "S3") | ||
val contents = TestUtils.getFileContents(context.manifest, "Sources/Example/models/FooInput.swift") | ||
contents.shouldSyntacticSanityCheck() | ||
val expectedContents = | ||
""" | ||
public struct FooInput { | ||
public var expires: Swift.String? | ||
public var payload1: Swift.String? | ||
|
||
public init( | ||
expires: Swift.String? = nil, | ||
payload1: Swift.String? = nil | ||
) | ||
{ | ||
self.expires = expires | ||
self.payload1 = payload1 | ||
} | ||
} | ||
""".trimIndent() | ||
val expectedContents = """ | ||
public struct FooInput: Swift.Sendable { | ||
public var expires: Swift.String? | ||
public var payload1: Swift.String? | ||
|
||
public init( | ||
expires: Swift.String? = nil, | ||
payload1: Swift.String? = nil | ||
) | ||
{ | ||
self.expires = expires | ||
self.payload1 = payload1 | ||
} | ||
} | ||
""" | ||
contents.shouldContainOnlyOnce(expectedContents) | ||
} | ||
|
||
|
@@ -64,7 +62,7 @@ class S3ExpiresTest { | |
val contents = TestUtils.getFileContents(context.manifest, "Sources/Example/models/FooOutput.swift") | ||
contents.shouldSyntacticSanityCheck() | ||
val expectedContents = """ | ||
public struct FooOutput { | ||
public struct FooOutput: Swift.Sendable { | ||
public var expires: Foundation.Date? | ||
public var payload1: Swift.String? | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using fully-qualified names in an extension declaration suppresses "retroactive conformance" warnings while still being compatible with Swift 5.x (using
@retroactive
in Swift 5 results in a compile error.)