-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
31 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
open class ParentClass { | ||
open func foo(a: Int) {} | ||
} |
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,5 @@ | ||
import ModuleA | ||
|
||
open class SubClass: ParentClass { | ||
open override func foo(a: String) {} | ||
} |
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,12 @@ | ||
#!/bin/zsh | ||
|
||
xcrun swiftc -emit-module -o build/ModuleA.swiftmodule ModuleA.swift | ||
|
||
echo "\033[34m>>> Compiler diagnostics with .swiftsourceinfo:\033[0m" | ||
xcrun swiftc -typecheck -Ibuild ModuleB.swift | ||
|
||
# We can also use `-avoid-emit-module-source-info` to avoid emitting .swiftsourceinfo files. | ||
rm build/ModuleA.swiftsourceinfo | ||
|
||
echo "\033[34m>>> Compiler diagnostics without .swiftsourceinfo:\033[0m" | ||
xcrun swiftc -typecheck -Ibuild ModuleB.swift |
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,8 @@ | ||
public protocol FooProtocol {} | ||
public struct FooStruct : FooProtocol {} | ||
|
||
extension FooProtocol where Self == FooStruct { | ||
public static var foo: String { | ||
"Hello, world!" | ||
} | ||
} |
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,5 @@ | ||
#!/bin/zsh | ||
|
||
# Emit the symbol graph for Foo.swift, | ||
# so that we can see the "SYNTHESIZED" symbols | ||
xcrun swiftc -emit-module -o build/Foo.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir build Foo.swift |