mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Patterns assert that a type is set in `getType`, check `hasType` before querying. rdar://146383201
19 lines
295 B
Swift
19 lines
295 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %target-swift-frontend -typecheck -verify -primary-file %t/a.swift %t/b.swift -plugin-path %swift-plugin-dir
|
|
|
|
//--- a.swift
|
|
|
|
func foo() {
|
|
_ = {
|
|
let i = 0
|
|
$bar.withValue(i) {}
|
|
}
|
|
}
|
|
|
|
//--- b.swift
|
|
|
|
@TaskLocal
|
|
var bar: Int?
|