From ca07cb66cd1cc341bd64a8d8bc0e46cfbe5383aa Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 12 Apr 2022 09:28:17 +0800 Subject: [PATCH] format typevars consistently --- nac3core/src/symbol_resolver.rs | 2 +- nac3core/src/toplevel/composer.rs | 2 +- nac3core/src/toplevel/test.rs | 4 ++-- nac3core/src/toplevel/type_annotation.rs | 2 +- nac3core/src/typecheck/typedef/mod.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nac3core/src/symbol_resolver.rs b/nac3core/src/symbol_resolver.rs index f6ce4fa3c..678016338 100644 --- a/nac3core/src/symbol_resolver.rs +++ b/nac3core/src/symbol_resolver.rs @@ -367,7 +367,7 @@ impl dyn SymbolResolver + Send + Sync { unreachable!("expected class definition") } }, - &mut |id| format!("var{}", id), + &mut |id| format!("typevar{}", id), &mut None, ) } diff --git a/nac3core/src/toplevel/composer.rs b/nac3core/src/toplevel/composer.rs index 0261aa7d5..856801136 100644 --- a/nac3core/src/toplevel/composer.rs +++ b/nac3core/src/toplevel/composer.rs @@ -1906,7 +1906,7 @@ impl TopLevelComposer { unreachable!("must be class id here") } }, - &mut |id| format!("tvar{}", id), + &mut |id| format!("typevar{}", id), &mut None, ); return Err(format!( diff --git a/nac3core/src/toplevel/test.rs b/nac3core/src/toplevel/test.rs index 41f7fa63f..e74c21db4 100644 --- a/nac3core/src/toplevel/test.rs +++ b/nac3core/src/toplevel/test.rs @@ -763,7 +763,7 @@ fn make_internal_resolver_with_tvar( (name, { let (ty, id) = unifier.get_fresh_var_with_range(range.as_slice(), None, None); if print { - println!("{}: {:?}, tvar{}", name, ty, id); + println!("{}: {:?}, typevar{}", name, ty, id); } ty }) @@ -791,7 +791,7 @@ impl<'a> Fold> for TypeToStringFolder<'a> { self.unifier.internal_stringify( ty, &mut |id| format!("class{}", id.to_string()), - &mut |id| format!("tvar{}", id.to_string()), + &mut |id| format!("typevar{}", id.to_string()), &mut None, ) } else { diff --git a/nac3core/src/toplevel/type_annotation.rs b/nac3core/src/toplevel/type_annotation.rs index cc8b4b3e0..bccd78675 100644 --- a/nac3core/src/toplevel/type_annotation.rs +++ b/nac3core/src/toplevel/type_annotation.rs @@ -356,7 +356,7 @@ pub fn get_type_from_type_annotation_kinds( unifier.internal_stringify( p, &mut |id| format!("class{}", id), - &mut |id| format!("tvar{}", id), + &mut |id| format!("typevar{}", id), &mut None ), *id diff --git a/nac3core/src/typecheck/typedef/mod.rs b/nac3core/src/typecheck/typedef/mod.rs index 9df1cd1c4..16248f812 100644 --- a/nac3core/src/typecheck/typedef/mod.rs +++ b/nac3core/src/typecheck/typedef/mod.rs @@ -830,7 +830,7 @@ impl Unifier { }, ) }, - &mut |id| format!("var{}", id), + &mut |id| format!("typevar{}", id), notes, ) }