Main.hx 297 B

123456789101112131415161718192021
  1. class Outcome {
  2. static function fromEither(ei:haxe.ds.Option<Err>) {
  3. switch ei {
  4. case Some(o):
  5. case _:
  6. }
  7. }
  8. }
  9. abstract Err(Bool) {
  10. @:from static public function fromInt(n:Int) {
  11. return new Err(here);
  12. }
  13. }
  14. class Main {
  15. static function main() {
  16. var err:Err = 5;
  17. trace(err);
  18. }
  19. }