mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 12:51:10 +00:00
Fix duplicate method definition bugs
This commit is contained in:
parent
da7b82d868
commit
7573c0e128
9 changed files with 113 additions and 12 deletions
|
@ -331,6 +331,30 @@ impl TyCheckError {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn duplicate_definition_error(
|
||||
errno: usize,
|
||||
loc: Location,
|
||||
caused_by: Str,
|
||||
name: &str,
|
||||
) -> Self {
|
||||
let name = readable_name(name);
|
||||
Self::new(
|
||||
ErrorCore::new(
|
||||
errno,
|
||||
NameError,
|
||||
loc,
|
||||
switch_lang!(
|
||||
"japanese" => format!("{name}は既に定義されています"),
|
||||
"simplified_chinese" => format!("{name}已定义"),
|
||||
"traditional_chinese" => format!("{name}已定義"),
|
||||
"english" => format!("{name} is already defined"),
|
||||
),
|
||||
Option::<Str>::None,
|
||||
),
|
||||
caused_by,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn violate_decl_error(
|
||||
errno: usize,
|
||||
loc: Location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue