mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
1. Removes gating on -enable-experimental-concurrency. 2. Updates eff. prop tests to remove experimental flag, and also adjusts some tests slightly to avoid things that are still behind that flag.
41 lines
1016 B
Swift
41 lines
1016 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
var intAsyncProp : Int {
|
|
get async { 0 }
|
|
}
|
|
|
|
var intThrowsProp : Int {
|
|
get throws { 0 }
|
|
}
|
|
|
|
var asyncThrowsProp : Int {
|
|
get async throws { try await intAsyncProp + intThrowsProp }
|
|
}
|
|
|
|
func hello() async {
|
|
_ = intThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
|
|
|
|
|
|
// expected-error@+1{{expression is 'async' but is not marked with 'await'}}{{7-7=await }}
|
|
_ = intAsyncProp // expected-note{{property access is 'async'}}
|
|
}
|
|
|
|
class C {
|
|
var counter : Int = 0
|
|
}
|
|
|
|
var refTypeThrowsProp : C {
|
|
get throws { return C() }
|
|
}
|
|
|
|
var refTypeAsyncProp : C {
|
|
get async { return C() }
|
|
}
|
|
|
|
func salam() async {
|
|
_ = refTypeThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
|
|
|
|
// expected-error@+1 {{expression is 'async' but is not marked with 'await'}}{{7-7=await }}
|
|
_ = refTypeAsyncProp // expected-note {{property access is 'async'}}
|
|
}
|