-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Fix some issues with overrides of materializeForSet #12614
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
Merged
slavapestov
merged 2 commits into
swiftlang:master
from
slavapestov:imported-materialize-for-set-override-bugs
Oct 27, 2017
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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
2 changes: 0 additions & 2 deletions
2
...ayout/final-stored-property/library.swift → ...inal-stored-property/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
final class Burger { | ||
let onions: Bool = true | ||
let cheeseSlices: Int = 0 | ||
|
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
.../constant-struct-with-padding/Other.swift → ...nt-struct-with-padding/Inputs/other.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
struct t { | ||
var a = false // (or e.g. var a: Int32 = 0) | ||
var b = 0.0 // (or e.g. var b: Int64 = 0) | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// RUN: %empty-directory(%t) | ||
|
||
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Other.swift | ||
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Inputs/other.swift | ||
|
||
print( g.a ) |
2 changes: 0 additions & 2 deletions
2
...e/constant-tuple-with-padding/Other.swift → ...ant-tuple-with-padding/Inputs/other.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1 @@ | ||
// RUN: true | ||
|
||
var g = (false, 0.0) |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// RUN: %empty-directory(%t) | ||
|
||
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Other.swift | ||
// RUN: %target-build-swift -O -whole-module-optimization %S/main.swift %S/Inputs/other.swift | ||
|
||
print( g.0 ) |
2 changes: 0 additions & 2 deletions
2
...ltifile/error-type/imported/library.swift → .../error-type/imported/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public func go() throws { | ||
throw AXError(0) | ||
} |
File renamed without changes.
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...ifile/error-type/one-module/library.swift → ...rror-type/one-module/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
enum NuclearMeltdown { | ||
case Critical | ||
case Mild | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Try with and without whole module optimization | ||
|
||
// RUN: %target-build-swift %S/library.swift %S/main.swift | ||
// RUN: %target-build-swift -whole-module-optimization %S/library.swift %S/main.swift | ||
|
||
// REQUIRES: executable_test | ||
// RUN: %target-build-swift %S/Inputs/library.swift %S/main.swift | ||
// RUN: %target-build-swift -whole-module-optimization %S/Inputs/library.swift %S/main.swift | ||
|
||
extension NuclearMeltdown : Error {} |
2 changes: 0 additions & 2 deletions
2
...file/error-type/two-modules/library.swift → ...ror-type/two-modules/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public enum NuclearMeltdown { | ||
case Critical | ||
case Mild | ||
|
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...file/extensions/two-modules/library.swift → ...tensions/two-modules/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public struct Point { | ||
public let x: Int | ||
public let y: Int | ||
|
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...rted-conformance/option-set/library.swift → ...nformance/option-set/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
import Foundation | ||
|
||
@inline(__always) | ||
|
This file contains hidden or 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
5 changes: 5 additions & 0 deletions
5
test/multifile/synthesized-accessors/materialize-for-set-1/Inputs/counter.h
This file contains hidden or 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 <Foundation/Foundation.h> | ||
|
||
@interface Counter : NSObject | ||
@property(readwrite) int value; | ||
@end |
12 changes: 12 additions & 0 deletions
12
test/multifile/synthesized-accessors/materialize-for-set-1/Inputs/library.swift
This file contains hidden or 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 @@ | ||
import Foundation | ||
import CounterFramework | ||
|
||
public protocol CounterProtocol { | ||
var value: Int32 { get set } | ||
} | ||
|
||
extension Counter : CounterProtocol {} | ||
|
||
open class MyCounter : Counter { | ||
open override var value: Int32 { didSet { } } | ||
} |
4 changes: 4 additions & 0 deletions
4
test/multifile/synthesized-accessors/materialize-for-set-1/Inputs/module.map
This file contains hidden or 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,4 @@ | ||
module CounterFramework { | ||
header "counter.h" | ||
export * | ||
} |
17 changes: 17 additions & 0 deletions
17
test/multifile/synthesized-accessors/materialize-for-set-1/main.swift
This file contains hidden or 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,17 @@ | ||
// RUN: %empty-directory(%t) | ||
|
||
// RUN: mkdir -p %t/onone %t/wmo | ||
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -I %S/Inputs/ -module-name=library %S/Inputs/library.swift | ||
// RUN: %target-build-swift %S/main.swift -I %S/Inputs/ -I %t/onone/ -emit-ir > /dev/null | ||
|
||
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -I %S/Inputs/ -module-name=library -wmo %S/Inputs/library.swift | ||
// RUN: %target-build-swift %S/main.swift -I %S/Inputs/ -I %t/wmo/ -emit-ir > /dev/null | ||
|
||
// REQUIRES: objc_interop | ||
|
||
import Foundation | ||
import library | ||
|
||
class CustomCounter : MyCounter { | ||
override var value: Int32 { didSet { } } | ||
} |
5 changes: 5 additions & 0 deletions
5
test/multifile/synthesized-accessors/materialize-for-set-2/Inputs/counter.h
This file contains hidden or 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 <Foundation/Foundation.h> | ||
|
||
@interface Counter : NSObject | ||
@property(readwrite) int value; | ||
@end |
8 changes: 8 additions & 0 deletions
8
test/multifile/synthesized-accessors/materialize-for-set-2/Inputs/library1.swift
This file contains hidden or 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 @@ | ||
import Foundation | ||
import CounterFramework | ||
|
||
public protocol CounterProtocol { | ||
var value: Int32 { get set } | ||
} | ||
|
||
extension Counter : CounterProtocol {} |
6 changes: 6 additions & 0 deletions
6
test/multifile/synthesized-accessors/materialize-for-set-2/Inputs/library2.swift
This file contains hidden or 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,6 @@ | ||
import Foundation | ||
import CounterFramework | ||
|
||
open class MyCounter : Counter { | ||
open override var value: Int32 { didSet { } } | ||
} |
4 changes: 4 additions & 0 deletions
4
test/multifile/synthesized-accessors/materialize-for-set-2/Inputs/module.map
This file contains hidden or 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,4 @@ | ||
module CounterFramework { | ||
header "counter.h" | ||
export * | ||
} |
17 changes: 17 additions & 0 deletions
17
test/multifile/synthesized-accessors/materialize-for-set-2/main.swift
This file contains hidden or 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,17 @@ | ||
// RUN: %empty-directory(%t) | ||
|
||
// RUN: mkdir -p %t/onone %t/wmo | ||
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -I %S/Inputs/ -module-name=library %S/Inputs/library1.swift %S/Inputs/library2.swift | ||
// RUN: %target-build-swift %S/main.swift -I %S/Inputs/ -I %t/onone/ -emit-ir > /dev/null | ||
|
||
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -I %S/Inputs/ -module-name=library -wmo %S/Inputs/library1.swift %S/Inputs/library2.swift | ||
// RUN: %target-build-swift %S/main.swift -I %S/Inputs/ -I %t/wmo/ -emit-ir > /dev/null | ||
|
||
// REQUIRES: objc_interop | ||
|
||
import Foundation | ||
import library | ||
|
||
class CustomCounter : MyCounter { | ||
override var value: Int32 { didSet { } } | ||
} |
2 changes: 0 additions & 2 deletions
2
...cessors/one-module-imported/library.swift → .../one-module-imported/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
import CoreGraphics | ||
|
||
// Case 1 - witness is imported accessor | ||
|
5 changes: 2 additions & 3 deletions
5
test/multifile/synthesized-accessors/one-module-imported/main.swift
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...cessors/one-module-internal/library.swift → .../one-module-internal/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
struct FishAndChips { | ||
var costPounds: Float | ||
var costEuros: Float { | ||
|
6 changes: 2 additions & 4 deletions
6
test/multifile/synthesized-accessors/one-module-internal/main.swift
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...accessors/one-module-public/library.swift → ...rs/one-module-public/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public struct FishAndChips { | ||
public var costPounds: Float | ||
public var costEuros: Float { | ||
|
6 changes: 2 additions & 4 deletions
6
test/multifile/synthesized-accessors/one-module-public/main.swift
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...essors/two-modules-imported/library.swift → ...two-modules-imported/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
import CoreGraphics | ||
|
||
public protocol OtherPoint { | ||
|
5 changes: 2 additions & 3 deletions
5
test/multifile/synthesized-accessors/two-modules-imported/main.swift
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...sized-accessors/two-modules/library.swift → ...ccessors/two-modules/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
#if _runtime(_ObjC) | ||
import Foundation | ||
#endif | ||
|
This file contains hidden or 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
2 changes: 0 additions & 2 deletions
2
...tifile/typealias/one-module/library.swift → ...typealias/one-module/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public enum Result<T, U> | ||
{ | ||
case success(T) | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
// RUN: %empty-directory(%t) | ||
|
||
// RUN: %target-build-swift %S/main.swift %S/library.swift | ||
// RUN: %target-build-swift -g %S/main.swift %S/library.swift | ||
|
||
// REQUIRES: executable_test | ||
// RUN: %target-build-swift %S/main.swift %S/Inputs/library.swift | ||
// RUN: %target-build-swift -g %S/main.swift %S/Inputs/library.swift | ||
|
||
func testFunction<T>(withCompletion completion: (Result<T, Error>) -> Void) { } | ||
testFunction { (result: GenericResult<Int>) in } |
2 changes: 0 additions & 2 deletions
2
...ifile/typealias/two-modules/library.swift → ...ypealias/two-modules/Inputs/library.swift
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// RUN: true | ||
|
||
public enum Result<T, U> | ||
{ | ||
case success(T) | ||
|
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.
For later: should this just be
final
?