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/expr/postfix/dot/init_ref_delegation.swift
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -513,6 +513,14 @@ class TestOptionalTrySub : TestOptionalTry {
513
513
514
514
structX{init(){}}
515
515
516
+
func+(lhs:X, rhs:X)->X{return lhs }
517
+
func testInsideOperator(x:X){
518
+
x.init()+ x // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{5-5=type(of: }} {{9-9=)}}
519
+
x + x.init() // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{9-9=type(of: }} {{13-13=)}}
520
+
x.init()+ x.init() // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{5-5=type(of: }} {{9-9=)}}
521
+
// expected-error@-1 {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{16-16=type(of: }} {{20-20=)}}
0 commit comments