mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +00:00
Add hint.rs in context
This commit is contained in:
parent
0844fb2f7a
commit
3550a0e4b5
7 changed files with 17 additions and 6 deletions
|
|
@ -513,6 +513,7 @@ impl TyCheckError {
|
|||
name: &str,
|
||||
expect: &Type,
|
||||
found: &Type,
|
||||
hint: Option<Str>,
|
||||
) -> Self {
|
||||
Self::new(
|
||||
ErrorCore::new(
|
||||
|
|
@ -525,7 +526,7 @@ impl TyCheckError {
|
|||
"traditional_chinese" => format!("{name}的類型不匹配:\n預期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"),
|
||||
"english" => format!("the type of {name} is mismatched:\nexpected: {GREEN}{expect}{RESET}\nbut found: {RED}{found}{RESET}"),
|
||||
),
|
||||
None,
|
||||
hint,
|
||||
),
|
||||
caused_by,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue