import RegexBuilder
switch "abc" {
case /\w+/:
print("It's a word!")
}
Gives an error:
expression failed to parse:
error: x.xcplaygroundpage:7:6: error: expression pattern of type 'Regex<Substring>' cannot match values of type 'String'
case /\w+/:
^
x.xcplaygroundpage:7:6: note: overloads for '~=' exist with these partially matching parameter lists: (Substring, String)
case /\w+/:
^