Skip to content

Commit 9419115

Browse files
authored
---
yaml --- r: 327653 b: refs/heads/tensorflow c: cd8fddd h: refs/heads/master i: 327651: 87bce53
1 parent cccdd10 commit 9419115

File tree

23 files changed

+139
-31
lines changed

23 files changed

+139
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: de4b63defc8bd1da3723fac59dd36b77cffdf869
819+
refs/heads/tensorflow: cd8fddd2df6a0509e06129f8eb517800303cfcaa
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
| **OS** | **Architecture** | **Build** |
1616
|---|:---:|:---:|
17-
|**[Debian 9.1 (Raspberry Pi)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/armv7_debian_stretch.json)** | ARMv7 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1)|
18-
|**[Fedora 27](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_fedora_27.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27)|
19-
|**[Ubuntu 16.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04)|
2017
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le)|
2118
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
2219
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|

branches/tensorflow/include/swift/AST/DiagnosticsModuleDiffer.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ ERROR(new_decl_without_intro,none,"%0 is a new API without @available attribute"
9898

9999
ERROR(objc_name_change,none,"%0 has ObjC name change from %1 to %2", (StringRef, StringRef, StringRef))
100100

101+
ERROR(desig_init_added,none,"%0 has been added as a designated initializer to an open class", (StringRef))
102+
101103
#ifndef DIAG_NO_UNDEF
102104
# if defined(DIAG)
103105
# undef DIAG

branches/tensorflow/include/swift/IDE/DigesterEnums.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ KEY_STRING(IntrotvOS, intro_tvOS)
152152
KEY_STRING(IntrowatchOS, intro_watchOS)
153153
KEY_STRING(Introswift, intro_swift)
154154
KEY_STRING(ObjCName, objc_name)
155+
KEY_STRING(InitKind, init_kind)
155156

156157
KEY_STRING_ARR(SuperclassNames, superclassNames)
157158
KEY_STRING_ARR(ToolArgs, tool_arguments)

branches/tensorflow/lib/FrontendTool/FrontendTool.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,10 +1122,12 @@ static bool performCompile(CompilerInstance &Instance,
11221122
if (Action == FrontendOptions::ActionType::Typecheck) {
11231123
if (emitIndexData(Invocation, Instance))
11241124
return true;
1125-
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance,
1126-
Invocation,
1127-
moduleIsPublic)) {
1128-
return true;
1125+
if (opts.InputsAndOutputs.isWholeModule()) {
1126+
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance,
1127+
Invocation,
1128+
moduleIsPublic)) {
1129+
return true;
1130+
}
11291131
}
11301132
return false;
11311133
}

branches/tensorflow/lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3901,11 +3901,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
39013901
return recordFix(fix) ? SolutionKind::Error : SolutionKind::Solved;
39023902
}
39033903

3904-
// Let's not try to fix missing conformance for Void
3905-
// or Never because that doesn't really make sense.
3906-
if (type->isVoid() || type->isUninhabited())
3907-
return SolutionKind::Error;
3908-
39093904
if (path.back().is<LocatorPathElt::AnyRequirement>()) {
39103905
// If this is a requirement associated with `Self` which is bound
39113906
// to `Any`, let's consider this "too incorrect" to continue.

branches/tensorflow/test/Constraints/rdar44770297.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ protocol P {
44
associatedtype A
55
}
66

7-
func foo<T: P>(_: () throws -> T) -> T.A? { // expected-note {{in call to function 'foo'}}
7+
func foo<T: P>(_: () throws -> T) -> T.A? { // expected-note {{where 'T' = 'Never'}}
88
fatalError()
99
}
1010

11-
let _ = foo() {fatalError()} & nil // expected-error {{generic parameter 'T' could not be inferred}}
11+
let _ = foo() {fatalError()} & nil // expected-error {{global function 'foo' requires that 'Never' conform to 'P'}}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// This test is very deliberately *not* indexing the current file; we need to
4+
// make sure the frontend job doesn't try to emit the auxiliary outputs based
5+
// on the non-indexed files. (This is how Xcode currently constructs -index-file
6+
// invocations: take a normal build command and add extra arguments to it.)
7+
// RUN: %target-build-swift -index-file -index-file-path %S/Inputs/SwiftModuleA.swift %S/Inputs/SwiftModuleA.swift %s -index-store-path %t/idx -module-name driver_index -emit-objc-header-path %t/out.h -emit-module-interface-path %t/out.swiftinterface
8+
9+
// RUN: test ! -f %t/out.h
10+
// RUN: test ! -f %t/out.swiftinterface
11+
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s
12+
13+
// CHECK-LABEL: module-name: driver_index
14+
// CHECK: DEPEND START
15+
// CHECK-NOT: Record |
16+
// CHECK: Record | user | {{.+}}SwiftModuleA.swift
17+
// CHECK-NOT: Record |
18+
// CHECK: DEPEND END
19+
20+
#if _runtime(_ObjC)
21+
22+
// Do a stronger test here involving checking @objc
23+
import ObjectiveC
24+
25+
public class PossiblyObjC: NSObject {
26+
@objc public init(x: Int) {}
27+
}
28+
29+
#else // _runtime(_ObjC)
30+
31+
public class Boring {
32+
init()
33+
}
34+
35+
#endif // _runtime(_ObjC)

branches/tensorflow/test/api-digester/Inputs/cake_baseline/cake.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,12 @@ public class SwiftObjcClass {
201201
@objc(OldObjCFool:OldObjCA:OldObjCB:)
202202
public func foo(a:Int, b:Int, c: Int) {}
203203
}
204+
205+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
206+
open class AddingNewDesignatedInit {
207+
public init() {}
208+
public convenience init(foo: Int) {
209+
self.init()
210+
print(foo)
211+
}
212+
}

branches/tensorflow/test/api-digester/Inputs/cake_current/cake.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,13 @@ public class SwiftObjcClass {
208208
@objc(NewObjCFool:NewObjCA:NewObjCB:)
209209
public func foo(a:Int, b:Int, c: Int) {}
210210
}
211+
212+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
213+
open class AddingNewDesignatedInit {
214+
public init(_ b: Bool) {}
215+
public init() {}
216+
public convenience init(foo: Int) {
217+
self.init()
218+
print(foo)
219+
}
220+
}

branches/tensorflow/test/api-digester/Outputs/Cake-abi.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,4 @@ cake: Var RequiementChanges.addedVar has been added as a protocol requirement
115115
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
116116
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
117117
cake: Class SuperClassRemoval has removed its super class cake.C3
118+
cake: Constructor AddingNewDesignatedInit.init(_:) has been added as a designated initializer to an open class

branches/tensorflow/test/api-digester/Outputs/Cake.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ cake: Accessor ClassWithOpenMember.property.Get() is no longer open for subclass
6464
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
6565
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
6666
cake: Class SuperClassRemoval has removed its super class cake.C3
67+
cake: Constructor AddingNewDesignatedInit.init(_:) has been added as a designated initializer to an open class
6768
cake: Func ClassWithOpenMember.bar() is no longer open for subclassing
6869
cake: Func ClassWithOpenMember.foo() is no longer open for subclassing
6970
cake: Var ClassWithOpenMember.property is no longer open for subclassing

branches/tensorflow/test/api-digester/Outputs/cake-abi.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@
564564
"implicit": true,
565565
"declAttributes": [
566566
"Inlinable"
567-
]
567+
],
568+
"init_kind": "Designated"
568569
},
569570
{
570571
"kind": "Var",
@@ -1823,5 +1824,5 @@
18231824
]
18241825
}
18251826
],
1826-
"json_format_version": 5
1827+
"json_format_version": 6
18271828
}

branches/tensorflow/test/api-digester/Outputs/cake.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@
584584
"implicit": true,
585585
"declAttributes": [
586586
"Inlinable"
587-
]
587+
],
588+
"init_kind": "Designated"
588589
},
589590
{
590591
"kind": "Var",
@@ -1674,5 +1675,5 @@
16741675
]
16751676
}
16761677
],
1677-
"json_format_version": 5
1678+
"json_format_version": 6
16781679
}

branches/tensorflow/test/api-digester/Outputs/clang-module-dump.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
"Override",
106106
"ObjC",
107107
"Dynamic"
108-
]
108+
],
109+
"init_kind": "Designated"
109110
}
110111
],
111112
"declKind": "Class",
@@ -183,5 +184,5 @@
183184
]
184185
}
185186
],
186-
"json_format_version": 5
187+
"json_format_version": 6
187188
}

branches/tensorflow/test/api-digester/Outputs/empty-baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"kind": "Root",
33
"name": "TopLevel",
44
"printedName": "TopLevel",
5-
"json_format_version": 5
5+
"json_format_version": 6
66
}

branches/tensorflow/test/type/opaque.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ func recursion(x: Int) -> some P {
172172
return recursion(x: x - 1)
173173
}
174174

175-
// FIXME: We need to emit a better diagnostic than the failure to convert Never to opaque.
176-
func noReturnStmts() -> some P { fatalError() } // expected-error{{cannot convert return expression of type 'Never' to return type 'some P'}} expected-error{{no return statements}}
175+
func noReturnStmts() -> some P {} // expected-error {{function declares an opaque return type, but has no return statements in its body from which to infer an underlying type}}
176+
177+
func returnUninhabited() -> some P { // expected-note {{opaque return type declared here}}
178+
fatalError() // expected-error{{return type of global function 'returnUninhabited()' requires that 'Never' conform to 'P'}}
179+
}
177180

178181
func mismatchedReturnTypes(_ x: Bool, _ y: Int, _ z: String) -> some P { // expected-error{{do not have matching underlying types}}
179182
if x {

branches/tensorflow/tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ SDKNodeDeclFunction::SDKNodeDeclFunction(SDKNodeInitInfo Info):
132132
FuncSelfKind(Info.FuncSelfKind) {}
133133

134134
SDKNodeDeclConstructor::SDKNodeDeclConstructor(SDKNodeInitInfo Info):
135-
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclConstructor) {}
135+
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclConstructor), InitKind(Info.InitKind) {}
136136

137137
SDKNodeDeclAccessor::SDKNodeDeclAccessor(SDKNodeInitInfo Info):
138138
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclAccessor),
@@ -1271,6 +1271,30 @@ static std::vector<DeclAttrKind> collectDeclAttributes(Decl *D) {
12711271
return Results;
12721272
}
12731273

1274+
CtorInitializerKind SDKNodeDeclConstructor::getInitKind() const {
1275+
#define CASE(KIND) if (InitKind == #KIND) return CtorInitializerKind::KIND;
1276+
CASE(Designated)
1277+
CASE(Convenience)
1278+
CASE(ConvenienceFactory)
1279+
CASE(Factory)
1280+
#undef CASE
1281+
llvm_unreachable("unhandled init kind");
1282+
}
1283+
1284+
StringRef SDKContext::getInitKind(Decl *D) {
1285+
if (auto *CD = dyn_cast<ConstructorDecl>(D)) {
1286+
switch(CD->getInitKind()) {
1287+
#define CASE(KIND) case CtorInitializerKind::KIND: return #KIND;
1288+
CASE(Designated)
1289+
CASE(Convenience)
1290+
CASE(ConvenienceFactory)
1291+
CASE(Factory)
1292+
#undef CASE
1293+
}
1294+
}
1295+
return StringRef();
1296+
}
1297+
12741298
SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
12751299
Ctx(Ctx), DKind(D->getKind()),
12761300
Location(calculateLocation(Ctx, D)),
@@ -1285,6 +1309,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
12851309
IntrowatchOS(Ctx.getPlatformIntroVersion(D, PlatformKind::watchOS)),
12861310
Introswift(Ctx.getLanguageIntroVersion(D)),
12871311
ObjCName(Ctx.getObjcName(D)),
1312+
InitKind(Ctx.getInitKind(D)),
12881313
IsImplicit(D->isImplicit()),
12891314
IsDeprecated(D->getAttrs().getDeprecated(D->getASTContext())),
12901315
IsABIPlaceholder(isABIPlaceholderRecursive(D)),
@@ -1916,6 +1941,11 @@ void SDKNodeDeclFunction::jsonize(json::Output &out) {
19161941
output(out, KeyKind::KK_funcSelfKind, FuncSelfKind);
19171942
}
19181943

1944+
void SDKNodeDeclConstructor::jsonize(json::Output &out) {
1945+
SDKNodeDeclAbstractFunc::jsonize(out);
1946+
output(out, KeyKind::KK_init_kind, InitKind);
1947+
}
1948+
19191949
void SDKNodeDeclType::jsonize(json::Output &out) {
19201950
SDKNodeDecl::jsonize(out);
19211951
output(out, KeyKind::KK_superclassUsr, SuperclassUsr);

branches/tensorflow/tools/swift-api-digester/ModuleAnalyzerNodes.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace api {
6262
///
6363
/// When the json format changes in a way that requires version-specific handling, this number should be incremented.
6464
/// This ensures we could have backward compatibility so that version changes in the format won't stop the checker from working.
65-
const uint8_t DIGESTER_JSON_VERSION = 5; // Populate ObjC, Dynamic and Final to attribute list
65+
const uint8_t DIGESTER_JSON_VERSION = 6; // Add initkind for constructors
6666
const uint8_t DIGESTER_JSON_DEFAULT_VERSION = 0; // Use this version number for files before we have a version number in json.
6767

6868
class SDKNode;
@@ -218,6 +218,7 @@ class SDKContext {
218218
StringRef getPlatformIntroVersion(Decl *D, PlatformKind Kind);
219219
StringRef getLanguageIntroVersion(Decl *D);
220220
StringRef getObjcName(Decl *D);
221+
StringRef getInitKind(Decl *D);
221222
bool isEqual(const SDKNode &Left, const SDKNode &Right);
222223
bool checkingABI() const { return Opts.ABI; }
223224
AccessLevel getAccessLevel(const ValueDecl *VD) const;
@@ -677,9 +678,12 @@ class SDKNodeDeclFunction: public SDKNodeDeclAbstractFunc {
677678
};
678679

679680
class SDKNodeDeclConstructor: public SDKNodeDeclAbstractFunc {
681+
StringRef InitKind;
680682
public:
681683
SDKNodeDeclConstructor(SDKNodeInitInfo Info);
682684
static bool classof(const SDKNode *N);
685+
CtorInitializerKind getInitKind() const;
686+
void jsonize(json::Output &Out) override;
683687
};
684688

685689
class SDKNodeDeclAccessor: public SDKNodeDeclAbstractFunc {

branches/tensorflow/tools/swift-api-digester/ModuleDiagsConsumer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static StringRef getCategoryName(uint32_t ID) {
7373
case LocalDiagID::super_class_removed:
7474
case LocalDiagID::super_class_changed:
7575
case LocalDiagID::no_longer_open:
76+
case LocalDiagID::desig_init_added:
7677
return "/* Class Inheritance Change */";
7778
default:
7879
return StringRef();

branches/tensorflow/tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,18 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
11441144
}
11451145
}
11461146
}
1147+
if (auto *CD = dyn_cast<SDKNodeDeclConstructor>(Right)) {
1148+
if (auto *TD = dyn_cast<SDKNodeDeclType>(Right->getParent())) {
1149+
if (TD->isOpen() && CD->getInitKind() == CtorInitializerKind::Designated) {
1150+
// If client's subclass provides an implementation of all of its superclass designated
1151+
// initializers, it automatically inherits all of the superclass convenience initializers.
1152+
// This means if a new designated init is added to the base class, the inherited
1153+
// convenience init may be missing and cause breakage.
1154+
CD->emitDiag(diag::desig_init_added);
1155+
}
1156+
}
1157+
}
1158+
11471159
return;
11481160
case NodeMatchReason::Removed:
11491161
assert(!Right);

branches/tensorflow/validation-test/Sema/type_checker_crashers_fixed/rdar50869732.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct Generic<T> {
1010

1111
@_functionBuilder
1212
struct Builder {
13-
static func buildBlock<C0, C1>(_ c0: C0, _ c1: C1)
13+
static func buildBlock<C0, C1>(_ c0: C0, _ c1: C1) // expected-note {{where 'C0' = 'Empty'}} expected-note {{where 'C1' = 'Test<Empty>'}}
1414
-> Generic<(C0, C1)> where C0 : P, C1 : P {
1515
return Generic((c0, c1))
1616
}
@@ -24,11 +24,13 @@ struct Empty {
2424
init() {}
2525
}
2626

27-
struct Test<T> where T : P {
27+
struct Test<T> where T : P { // expected-note {{where 'T' = 'Empty'}}
2828
init(@Builder _: () -> T) {}
2929
}
3030

3131
let x = G {
32+
// expected-error@-1 {{static method 'buildBlock' requires that 'Empty' conform to 'P'}}
33+
// expected-error@-2 {{static method 'buildBlock' requires that 'Test<Empty>' conform to 'P'}}
3234
Empty()
33-
Test { <#code#> } // expected-error {{editor placeholder in source file}}
35+
Test { Empty() } // expected-error {{generic struct 'Test' requires that 'Empty' conform to 'P'}}
3436
}

branches/tensorflow/validation-test/compiler_crashers_2_fixed/0196-rdar48937223.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
protocol P {}
44

5-
func fn<T, U: P>(_ arg1: T, arg2: (T) -> U) {}
5+
func fn<T, U: P>(_ arg1: T, arg2: (T) -> U) {} // expected-note {{where 'U' = '()'}}
66

77
func test(str: String) {
8-
fn(str) { arg in
8+
fn(str) { arg in // expected-error {{global function 'fn(_:arg2:)' requires that '()' conform to 'P'}}
99
<#FOO#> // expected-error {{editor placeholder in source file}}
1010
}
1111
}

0 commit comments

Comments
 (0)