pub fn expect_subtype(
        &self,
        span: FileSpan,
        ty1: &domain::RcType,
        ty2: &domain::RcType,
    ) -> Result<(), Diagnostic<FileSpan>> {
        match nbe::check_subtype(self.level(), ty1, ty2) {
            Ok(true) => Ok(()),
            Ok(false) => Err(Diagnostic::new_error("not a subtype").with_label(
                DiagnosticLabel::new_primary(span).with_message(format!(
                    "`{}` is not a subtype of `{}`",
                    self.read_back(None, ty1).unwrap(),
                    self.read_back(None, ty2).unwrap(),
                )),
            )),
            Err(error) => {
                let message = format!("failed subtype check: {}", error);
                Err(Diagnostic::new_bug(message))
            },
        }
    }
/// Expect that `ty1` is a subtype of `ty2` in the current context
Expect that `ty1` is a subtype of `ty2` in the current context
Expect that ` ty1 ` is a subtype of ` ty2 ` in the current context
pub fn expect_subtype(
        &self,
        span: FileSpan,
        ty1: &domain::RcType,
        ty2: &domain::RcType,
    ) -> Result<(), Diagnostic<FileSpan>> {
        match nbe::check_subtype(self.level(), ty1, ty2) {
            Ok(true) => Ok(()),
            Ok(false) => Err(Diagnostic::new_error("not a subtype").with_label(
                DiagnosticLabel::new_primary(span).with_message(format!(
                    "`{}` is not a subtype of `{}`",
                    self.read_back(None, ty1).unwrap(),
                    self.read_back(None, ty2).unwrap(),
                )),
            )),
            Err(error) => {
                let message = format!("failed subtype check: {}", error);
                Err(Diagnostic::new_bug(message))
            },
        }
    }
pub fn expect_subtype ( & self , span : FileSpan , ty1 : & domain :: RcType , ty2 : & domain :: RcType , ) -> Result < ( ) , Diagnostic < FileSpan > > { match nbe :: check_subtype ( self . level ( ) , ty1 , ty2 ) { Ok ( true ) => Ok ( ( ) ) , Ok ( false ) => Err ( Diagnostic :: new_error ( " " ) . with_label ( DiagnosticLabel :: new_primary ( span ) . with_message ( format ! ( " " self read_back ( None ty1 ) unwrap ( ) self read_back ( None ty2 ) unwrap ( ) ) ) , ) ) , Err ( error ) => { let message = format ! ( " " error ) ; Err ( Diagnostic :: new_bug ( message ) ) } , } }
Expect that `ty1` is a subtype of `ty2` in the current context
Expect that ` ty1 ` is a subtype of ` ty2 ` in the current context
&self
span
FileSpan
ty1
&domain::RcType
ty2
&domain::RcType