mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Update inquire.rs
This commit is contained in:
parent
bbd66e5936
commit
d452a2d734
1 changed files with 12 additions and 15 deletions
|
@ -85,20 +85,18 @@ impl Context {
|
||||||
|
|
||||||
fn get_singular_ctx(&self, obj: &hir::Expr, namespace: &Str) -> TyCheckResult<&Context> {
|
fn get_singular_ctx(&self, obj: &hir::Expr, namespace: &Str) -> TyCheckResult<&Context> {
|
||||||
match obj {
|
match obj {
|
||||||
hir::Expr::Accessor(hir::Accessor::Ident(ident)) => {
|
hir::Expr::Accessor(hir::Accessor::Ident(ident)) => self
|
||||||
log!(err "{ident}: {}", self.get_mod(ident.inspect()).is_some());
|
.get_mod(ident.inspect())
|
||||||
self.get_mod(ident.inspect())
|
.or_else(|| self.rec_get_type(ident.inspect()).map(|(_, ctx)| ctx))
|
||||||
.or_else(|| self.rec_get_type(ident.inspect()).map(|(_, ctx)| ctx))
|
.ok_or_else(|| {
|
||||||
.ok_or_else(|| {
|
TyCheckError::no_var_error(
|
||||||
TyCheckError::no_var_error(
|
line!() as usize,
|
||||||
line!() as usize,
|
obj.loc(),
|
||||||
obj.loc(),
|
namespace.into(),
|
||||||
namespace.into(),
|
ident.inspect(),
|
||||||
ident.inspect(),
|
self.get_similar_name(ident.inspect()),
|
||||||
self.get_similar_name(ident.inspect()),
|
)
|
||||||
)
|
}),
|
||||||
})
|
|
||||||
}
|
|
||||||
hir::Expr::Accessor(hir::Accessor::Attr(attr)) => {
|
hir::Expr::Accessor(hir::Accessor::Attr(attr)) => {
|
||||||
// REVIEW: 両方singularとは限らない?
|
// REVIEW: 両方singularとは限らない?
|
||||||
let ctx = self.get_singular_ctx(&attr.obj, namespace)?;
|
let ctx = self.get_singular_ctx(&attr.obj, namespace)?;
|
||||||
|
@ -532,7 +530,6 @@ impl Context {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
log!(info "{}, {}", callee.ref_t(), after);
|
|
||||||
self.reunify(callee.ref_t(), after, Some(callee.loc()), None)?;
|
self.reunify(callee.ref_t(), after, Some(callee.loc()), None)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue