Skip to content

Commit

Permalink
Merge pull request #3564 from michaellilltokiwa/lib--option/outcome,-…
Browse files Browse the repository at this point in the history
…change-panic-messages

lib: option/outcome, change panic messages
  • Loading branch information
fridis committed Sep 12, 2024
2 parents c8baddb + eb483e4 commit 96ed830
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/outcome.fz
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ is
#
public err error
pre
safety: (outcome.this!!)
safety: outcome.this!!
=>
outcome.this ? T => panic "outcome.err called on successful outcome"
outcome.this ? T => panic "outcome.err called on successful outcome. Enable `safety` to obtain a precondition failure for debugging."
| e error => e


Expand Down
4 changes: 2 additions & 2 deletions lib/switch.fz
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ is
safety: switch.this??
=>
switch.this ? a A => a
| B => fuzion.std.panic "switch.get called on B"
| B => fuzion.std.panic "switch.get called on B. Enable `safety` to obtain a precondition failure for debugging."


# unwrap value or get default
Expand All @@ -91,7 +91,7 @@ is
safety: switch.this??
=>
switch.this ? a A => a
| B => panic "switch.val called on B"
| B => panic "switch.val called on B. Enable `safety` to obtain a precondition failure for debugging."


# value of a switch or default if switch contains B
Expand Down

0 comments on commit 96ed830

Please sign in to comment.