mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
Prohibit inner scope type definition
This commit is contained in:
parent
f6e1a7b117
commit
6cfb0d1544
4 changed files with 37 additions and 5 deletions
|
@ -1296,6 +1296,24 @@ passed keyword args: {RED}{kw_args_len}{RESET}"
|
|||
pub fn file_error(errno: usize, desc: String, loc: Location, caused_by: AtomicStr) -> Self {
|
||||
Self::new(ErrorCore::new(errno, IoError, loc, desc, None), caused_by)
|
||||
}
|
||||
|
||||
pub fn inner_typedef_error(errno: usize, loc: Location, caused_by: AtomicStr) -> Self {
|
||||
Self::new(
|
||||
ErrorCore::new(
|
||||
errno,
|
||||
TypeError,
|
||||
loc,
|
||||
switch_lang!(
|
||||
"japanese" => format!("型はトップレベルで定義されなければなりません"),
|
||||
"simplified_chinese" => format!("类型必须在顶层定义"),
|
||||
"traditional_chinese" => format!("類型必須在頂層定義"),
|
||||
"english" => format!("types must be defined at the top level"),
|
||||
),
|
||||
None,
|
||||
),
|
||||
caused_by,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue