Prohibit inner scope type definition

This commit is contained in:
Shunsuke Shibayama 2022-09-25 18:43:45 +09:00
parent f6e1a7b117
commit 6cfb0d1544
4 changed files with 37 additions and 5 deletions

View file

@ -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)]