diff --git a/compiler/erg_compiler/ty/free.rs b/compiler/erg_compiler/ty/free.rs index cc7da214..e465ccb4 100644 --- a/compiler/erg_compiler/ty/free.rs +++ b/compiler/erg_compiler/ty/free.rs @@ -255,14 +255,18 @@ impl LimitedDisplay for FreeKind { constraint, } => { if *lev == GENERIC_LEVEL { - write!(f, "{name}(")?; - constraint.limited_fmt(f, limit - 1)?; - write!(f, ")")?; - } else { - write!(f, "?{name}(")?; - constraint.limited_fmt(f, limit - 1)?; - write!(f, ")")?; + write!(f, "{name}")?; if cfg!(feature = "debug") { + write!(f, "(")?; + constraint.limited_fmt(f, limit - 1)?; + write!(f, ")")?; + } + } else { + write!(f, "?{name}")?; + if cfg!(feature = "debug") { + write!(f, "(")?; + constraint.limited_fmt(f, limit - 1)?; + write!(f, ")")?; write!(f, "[{lev}]")?; } } @@ -274,14 +278,18 @@ impl LimitedDisplay for FreeKind { constraint, } => { if *lev == GENERIC_LEVEL { - write!(f, "%{id}(")?; - constraint.limited_fmt(f, limit - 1)?; - write!(f, ")")?; - } else { - write!(f, "?{id}(")?; - constraint.limited_fmt(f, limit - 1)?; - write!(f, ")")?; + write!(f, "%{id}")?; if cfg!(feature = "debug") { + write!(f, "(")?; + constraint.limited_fmt(f, limit - 1)?; + write!(f, ")")?; + } + } else { + write!(f, "?{id}")?; + if cfg!(feature = "debug") { + write!(f, "(")?; + constraint.limited_fmt(f, limit - 1)?; + write!(f, ")")?; write!(f, "[{lev}]")?; } } diff --git a/compiler/erg_compiler/ty/mod.rs b/compiler/erg_compiler/ty/mod.rs index 9e63146a..4759c070 100644 --- a/compiler/erg_compiler/ty/mod.rs +++ b/compiler/erg_compiler/ty/mod.rs @@ -1192,7 +1192,7 @@ impl LimitedDisplay for Type { write!(f, "|")?; for (i, (name, constr)) in qvars.iter().enumerate() { if i != 0 { - write!(f, "; ")?; + write!(f, ", ")?; } write!(f, "{name}")?; constr.limited_fmt(f, limit - 1)?;