Files
swift-mirror/test/Constraints/sub-pattern-matching-of-enum-element-for-closure.swift
takeshi-komori 29bf82ebed [CSSimplify] Fix sub-pattern matching logic related closure and enum element (#62777)
* [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>
2023-01-03 01:18:38 -08:00

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
}