This PR fixes the compiler handling of pattern matching on the `String` constructor to conform to the new `String` representation.
10 lines
266 B
Text
10 lines
266 B
Text
-- Test that pattern matching on the `String.ofByteArray` constructor works correctly
|
||
-- at runtime.
|
||
|
||
def getBytes (s : String) : ByteArray :=
|
||
match s with
|
||
| ⟨bs, _⟩ => bs
|
||
|
||
#eval getBytes "hello" |>.size
|
||
#eval getBytes "" |>.size
|
||
#eval getBytes "α" |>.size
|