Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serialization: When deserializing a typealias, build its generic sign…
…ature We were forgetting to do this, triggering crashes when using a generic typealias from another module. Fixes <https://bugs.swift.org/browse/SR-1889>.
- Loading branch information
1 parent
40ba708
commit c06fd1a
Showing
4 changed files
with
38 additions
and
0 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: true | ||
|
||
public enum Result<T, U> | ||
{ | ||
case success(T) | ||
case failure(U) | ||
} | ||
|
||
public typealias GenericResult<T> = Result<T, ErrorProtocol> |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: rm -rf %t && mkdir %t | ||
|
||
// RUN: mkdir %t/linker | ||
// RUN: %target-build-swift -emit-module -c %S/library.swift -o %t/linker/library.o | ||
// RUN: %target-build-swift -emit-library -c %S/library.swift -o %t/linker/library.o | ||
// RUN: %target-build-swift %S/main.swift %t/linker/library.o -I %t/linker/ -L %t/linker/ -o %t/linker/main | ||
|
||
// REQUIRES: executable_test | ||
|
||
import library | ||
|
||
func testFunction<T>(withCompletion completion: (Result<T, ErrorProtocol>) -> Void) { } | ||
testFunction { (result: GenericResult<Int>) in } |