fix: throw error on duplicated let entry
This commit is contained in:
@@ -11,14 +11,17 @@ mimalloc = "0.1"
|
|||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
rustyline = "14.0"
|
rustyline = "14.0"
|
||||||
|
|
||||||
regex = "1.11"
|
|
||||||
hashbrown = "0.16"
|
|
||||||
derive_more = { version = "2", features = ["full"] }
|
derive_more = { version = "2", features = ["full"] }
|
||||||
thiserror = "2"
|
|
||||||
string-interner = "0.19"
|
|
||||||
itertools = "0.14"
|
|
||||||
pin-project = "1"
|
pin-project = "1"
|
||||||
|
|
||||||
|
hashbrown = "0.16"
|
||||||
|
string-interner = "0.19"
|
||||||
|
|
||||||
|
thiserror = "2"
|
||||||
|
itertools = "0.14"
|
||||||
|
|
||||||
|
regex = "1.11"
|
||||||
|
|
||||||
deno_core = "0.376"
|
deno_core = "0.376"
|
||||||
deno_error = "0.7"
|
deno_error = "0.7"
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,13 @@ where
|
|||||||
ast::Entry::Inherit(inherit) => {
|
ast::Entry::Inherit(inherit) => {
|
||||||
for attr in inherit.attrs() {
|
for attr in inherit.attrs() {
|
||||||
if let ast::Attr::Ident(ident) = attr {
|
if let ast::Attr::Ident(ident) = attr {
|
||||||
binding_syms.insert(ctx.new_sym(ident.to_string()));
|
let sym = ctx.new_sym(ident.to_string());
|
||||||
|
if !binding_syms.insert(sym) {
|
||||||
|
return Err(Error::downgrade_error(format!(
|
||||||
|
"attribute '{}' already defined",
|
||||||
|
format_symbol(ctx.get_sym(sym))
|
||||||
|
)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,7 +257,13 @@ where
|
|||||||
if let Some(first_attr) = attrpath.attrs().next()
|
if let Some(first_attr) = attrpath.attrs().next()
|
||||||
&& let ast::Attr::Ident(ident) = first_attr
|
&& let ast::Attr::Ident(ident) = first_attr
|
||||||
{
|
{
|
||||||
binding_syms.insert(ctx.new_sym(ident.to_string()));
|
let sym = ctx.new_sym(ident.to_string());
|
||||||
|
if !binding_syms.insert(sym) {
|
||||||
|
return Err(Error::downgrade_error(format!(
|
||||||
|
"attribute '{}' already defined",
|
||||||
|
format_symbol(ctx.get_sym(sym))
|
||||||
|
)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user