Skip to content

Commit 0c47991

Browse files
author
jreference
committed
61440-fix-test-formatting
1 parent d18b2ca commit 0c47991

File tree

1 file changed

+22
-32
lines changed

1 file changed

+22
-32
lines changed

test/Sema/generic-subscript.swift

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,34 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
4-
protocol P
5-
{
6-
subscript<Value>(x:Value) -> Int // expected-note {{protocol requires subscript with type '<Value> (Value) -> Int'; do you want to add a stub?}}
7-
{
8-
get
9-
}
3+
protocol P {
4+
subscript<Value>(x: Value) -> Int // expected-note {{protocol requires subscript with type '<Value> (Value) -> Int'; do you want to add a stub?}}
5+
{
6+
get
7+
}
108
}
119

12-
struct S:P // expected-error {{type 'S' does not conform to protocol 'P'}}
10+
struct S: P // expected-error {{type 'S' does not conform to protocol 'P'}}
1311
{
14-
subscript<Value>(x:Int) -> Value // expected-note {{candidate has non-matching type '<Value> (Int) -> Value'}}
15-
{
16-
} // expected-error {{missing return in subscript expected to return 'Value'}}
12+
subscript<Value>(x: Int) -> Value // expected-note {{candidate has non-matching type '<Value> (Int) -> Value'}}
13+
{
14+
} // expected-error {{missing return in subscript expected to return 'Value'}}
1715
}
1816

19-
20-
21-
struct S2:P
22-
{
23-
subscript<Value>(x:Value) -> Int
24-
{
25-
return 123;
26-
}
17+
struct S2: P {
18+
subscript<Value>(x: Value) -> Int {
19+
return 123
20+
}
2721
}
2822

29-
protocol P2
30-
{
31-
subscript(x:Int) -> Int
32-
{
33-
get
34-
}
23+
protocol P2 {
24+
subscript(x: Int) -> Int
25+
{
26+
get
27+
}
3528
}
3629

37-
struct S3:P2
38-
{
39-
subscript(x:Int) -> Int
40-
{
41-
return x;
42-
}
30+
struct S3: P2 {
31+
subscript(x: Int) -> Int {
32+
return x
33+
}
4334
}
44-

0 commit comments

Comments
 (0)