From e3a96776d18a8b17a495e7163d65e0e474117d0c Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Mon, 27 May 2024 10:37:08 +0800 Subject: [PATCH] add panic --- builtin/builtin.mbti | 2 ++ builtin/intrinsics.mbt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/builtin/builtin.mbti b/builtin/builtin.mbti index 965dac73e..0bfb895e4 100644 --- a/builtin/builtin.mbti +++ b/builtin/builtin.mbti @@ -19,6 +19,8 @@ fn op_lt[T : Compare + Eq](T, T) -> Bool fn op_notequal[T : Eq](T, T) -> Bool +fn panic[T]() -> T + fn physical_equal[T](T, T) -> Bool fn print[T : Show](T) -> Unit diff --git a/builtin/intrinsics.mbt b/builtin/intrinsics.mbt index e882bcac5..bb8df7863 100644 --- a/builtin/intrinsics.mbt +++ b/builtin/intrinsics.mbt @@ -20,6 +20,8 @@ pub fn print_string(s : String) -> Unit = "%print_string" pub fn abort[T](msg : String) -> T = "%abort" +pub fn panic[T]() -> T = "%panic" + // Bool primitive ops pub fn Bool::not(self : Bool) -> Bool = "%bool_not"