mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* [CSSimplify] fix pattern matching logic which is as part of the enum element for closure
* add test
* Fixed logic to apply to N levels of nesting
* update tests that take into account N levels of nesting.
* fix indentation
* use dynamic variables and uppdate some logic
* Revert "use dynamic variables and uppdate some logic"
This reverts commit 279dc4fe6b.
* fix logic to only see pattern matches
* clean up unnecessary logic
Co-authored-by: Luciano Almeida <passos.luciano@outlook.com>
* Clean up unnecessary logic(2)
* remove dropping
* Fix documentation comments to match current context
* clean up unnecessary logic
* remove comments
Co-authored-by: Luciano Almeida <passos.luciano@outlook.com>
19 lines
402 B
Swift
19 lines
402 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
enum TestType {
|
|
case foo
|
|
case bar(Bool, (a: String, (b: String, (String, (c: String, Bool), String), String)))
|
|
}
|
|
|
|
func test(type: TestType) -> String {
|
|
let str: String = {
|
|
switch type {
|
|
case .foo:
|
|
return ""
|
|
case .bar(_, (_, (_, (_, (let c, _), _), _))):
|
|
return c
|
|
}
|
|
}()
|
|
|
|
return str
|
|
}
|