Skip to content

Commit ab262b7

Browse files
committed
[tests] Move opaque placeholder test into opaque types file
1 parent 16a4031 commit ab262b7

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

test/Sema/placeholder_type.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ extension Bar {
9797
}
9898
}
9999

100-
protocol P {}
101-
struct ConformsToP: P{}
102-
103-
func somePlaceholder() -> some _ { ConformsToP() } // expected-error {{placeholder type not allowed here}}
104-
105100
// FIXME: We should probably have better diagnostics for these situations--the user probably meant to use implicit member syntax
106101
let _: Int = _() // expected-error {{type of expression is ambiguous without more context}}
107102
let _: () -> Int = { _() } // expected-error {{unable to infer closure type in the current context}}

test/type/opaque.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,6 @@ func takesOpaqueProtocol<T : OpaqueProtocol>(generic: T) {
518518
_ = generic.getAsSome()
519519
_ = generic[0]
520520
}
521+
522+
func opaquePlaceholderFunc() -> some _ { 1 } // expected-error {{placeholder type not allowed here}}
523+
var opaquePlaceholderVar: some _ = 1 // expected-error {{placeholder type not allowed here}}

0 commit comments

Comments
 (0)