You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Parse/type_expr.swift
+28-2Lines changed: 28 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,10 @@ func unqualifiedType() {
53
53
_ =Foo.instMeth
54
54
55
55
_ = Foo // expected-error{{expected member name or constructor call after type name}} expected-note{{add arguments}} {{10-10=()}} expected-note{{use '.self'}} {{10-10=.self}}
56
+
_ =Foo.dynamicType // expected-error {{expected member name or constructor call after type name}}
57
+
// expected-error@-1 {{'.dynamicType' is deprecated. Use 'type(of: ...)' instead}} {{7-7=type(of: }} {{10-22=)}}
58
+
// expected-note@-2 {{add arguments after the type to construct a value of the type}}
59
+
// expected-note@-3 {{use '.self' to reference the type object}}
56
60
57
61
_ = Bad // expected-error{{expected member name or constructor call after type name}}
58
62
// expected-note@-1{{use '.self' to reference the type object}}{{10-10=.self}}
@@ -69,6 +73,10 @@ func qualifiedType() {
69
73
_ =Foo.Bar.instMeth
70
74
71
75
_ =Foo.Bar // expected-error{{expected member name or constructor call after type name}} expected-note{{add arguments}} {{14-14=()}} expected-note{{use '.self'}} {{14-14=.self}}
76
+
_ =Foo.Bar.dynamicType // expected-error {{expected member name or constructor call after type name}}
77
+
// expected-error@-1 {{'.dynamicType' is deprecated. Use 'type(of: ...)' instead}} {{7-7=type(of: }} {{14-26=)}}
78
+
// expected-note@-2 {{add arguments after the type to construct a value of the type}}
79
+
// expected-note@-3 {{use '.self' to reference the type object}}
72
80
}
73
81
74
82
/* TODO allow '.Type' in expr context
@@ -102,9 +110,27 @@ func genQualifiedType() {
102
110
_ =Gen<Foo>.Bar.instMeth
103
111
104
112
_ = Gen<Foo>.Bar
113
+
_ =Gen<Foo>.Bar.dynamicType // expected-error {{'.dynamicType' is deprecated. Use 'type(of: ...)' instead}} {{7-7=type(of: }} {{19-31=)}}
0 commit comments