You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
$ return match 1 with let? x then 1 else 0
Response. 0 : Integer
$ return match 1 with let? x then x else 0
Response. 0 : Integer
$ return 1 ?? 0
Response. 0 : Integer
$ define concept A{x:String}
$ return match A{x:"foo"} with let? x: A then x else 0
Response. 0 : Any
$ return 1?.a
Response. none : Nothing?
$ return {a: 1}?.a
Response. none : Nothing?
Although one could argue that this is a reasonable semantics, I think one could make a case that pattern matching should work on types consistent with the pattern (with let x? only for option types, with let x : B only for classes, with let x = 1 only for Integer, etc.).
Note that if considering e1 ?? e2 to be syntactic sugar / consistent with pattern matching, then issue #387 argue that optional matching against a non-optional type should be an error.
The text was updated successfully, but these errors were encountered:
It's unclear that any of those should be allowed:
Although one could argue that this is a reasonable semantics, I think one could make a case that pattern matching should work on types consistent with the pattern (
with let x?
only for option types,with let x : B
only for classes,with let x = 1
only for Integer, etc.).Note that if considering
e1 ?? e2
to be syntactic sugar / consistent with pattern matching, then issue #387 argue that optional matching against a non-optional type should be an error.The text was updated successfully, but these errors were encountered: