@@ -249,13 +249,8 @@ pub enum StaticCheckErrorKind {
249249 /// Supertype (i.e. common denominator between two types) exceeds the maximum allowed size or complexity.
250250 SupertypeTooLarge ,
251251
252- // Unexpected interpreter behavior
253252 /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
254- ExpectsRejectable ( String ) ,
255- // Unexpected interpreter behavior
256- /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
257- /// This error does NOT indicate a transaction would invalidate a block if included.
258- ExpectsAcceptable ( String ) ,
253+ Unreachable ( String ) ,
259254
260255 // Match expression errors
261256 /// Invalid syntax in an `option` match expression.
@@ -660,7 +655,7 @@ impl StaticCheckErrorKind {
660655 pub fn rejectable_in_epoch ( & self , epoch : StacksEpochId ) -> bool {
661656 match self {
662657 StaticCheckErrorKind :: SupertypeTooLarge => epoch. rejects_supertype_too_large ( ) ,
663- StaticCheckErrorKind :: ExpectsRejectable ( _) => true ,
658+ StaticCheckErrorKind :: Unreachable ( _) => true ,
664659 _ => false ,
665660 }
666661 }
@@ -724,22 +719,20 @@ impl From<ClarityTypeError> for StaticCheckErrorKind {
724719 | ClarityTypeError :: TypeMismatchValue ( _, _)
725720 | ClarityTypeError :: ResponseTypeMismatch { .. }
726721 | ClarityTypeError :: InvalidAsciiCharacter ( _)
727- | ClarityTypeError :: InvalidUtf8Encoding => Self :: ExpectsAcceptable ( format ! (
728- "Unexpected error type during static analysis: {err}"
729- ) ) ,
730- ClarityTypeError :: InvariantViolation ( _)
731- | ClarityTypeError :: InvalidPrincipalVersion ( _) => Self :: ExpectsRejectable ( format ! (
722+ | ClarityTypeError :: InvalidUtf8Encoding
723+ | ClarityTypeError :: InvariantViolation ( _)
724+ | ClarityTypeError :: InvalidPrincipalVersion ( _) => Self :: Unreachable ( format ! (
732725 "Unexpected error type during static analysis: {err}"
733726 ) ) ,
734727 ClarityTypeError :: CouldNotDetermineSerializationType => {
735728 Self :: CouldNotDetermineSerializationType
736729 }
737730 ClarityTypeError :: CouldNotDetermineType => Self :: CouldNotDetermineType ,
738731 ClarityTypeError :: UnsupportedTypeInEpoch ( ty, epoch) => {
739- Self :: ExpectsRejectable ( format ! ( "{ty} should not be used in {epoch}" ) )
732+ Self :: Unreachable ( format ! ( "{ty} should not be used in {epoch}" ) )
740733 }
741734 ClarityTypeError :: UnsupportedEpoch ( epoch) => {
742- Self :: ExpectsRejectable ( format ! ( "{epoch} is not supported" ) )
735+ Self :: Unreachable ( format ! ( "{epoch} is not supported" ) )
743736 }
744737 }
745738 }
@@ -875,10 +868,10 @@ impl From<CostErrors> for StaticCheckErrorKind {
875868 CostErrors :: CostContractLoadFailure => {
876869 StaticCheckErrorKind :: CostComputationFailed ( "Failed to load cost contract" . into ( ) )
877870 }
878- CostErrors :: InterpreterFailure => StaticCheckErrorKind :: ExpectsRejectable (
871+ CostErrors :: InterpreterFailure => StaticCheckErrorKind :: Unreachable (
879872 "Unexpected interpreter failure in cost computation" . into ( ) ,
880873 ) ,
881- CostErrors :: Expect ( s) => StaticCheckErrorKind :: ExpectsRejectable ( s) ,
874+ CostErrors :: Expect ( s) => StaticCheckErrorKind :: Unreachable ( s) ,
882875 CostErrors :: ExecutionTimeExpired => StaticCheckErrorKind :: ExecutionTimeExpired ,
883876 }
884877 }
@@ -1101,8 +1094,7 @@ impl DiagnosableError for StaticCheckErrorKind {
11011094 fn message ( & self ) -> String {
11021095 match & self {
11031096 StaticCheckErrorKind :: SupertypeTooLarge => "supertype of two types is too large" . into ( ) ,
1104- StaticCheckErrorKind :: ExpectsRejectable ( s) => format ! ( "unexpected and unacceptable interpreter behavior: {s}" ) ,
1105- StaticCheckErrorKind :: ExpectsAcceptable ( s) => format ! ( "unexpected but acceptable interpreter behaviour: {s}" ) ,
1097+ StaticCheckErrorKind :: Unreachable ( s) => format ! ( "unexpected and unacceptable interpreter behavior: {s}" ) ,
11061098 StaticCheckErrorKind :: BadMatchOptionSyntax ( source) =>
11071099 format ! ( "match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: {}" ,
11081100 source. message( ) ) ,
0 commit comments