Update lower.rs

This commit is contained in:
Shunsuke Shibayama 2022-12-14 05:15:55 +09:00
parent 855d463011
commit 20d6943fbe

View file

@ -1910,9 +1910,11 @@ impl ASTLowerer {
let mut dummy_tv_cache = TyVarCache::new(self.ctx.level, &self.ctx); let mut dummy_tv_cache = TyVarCache::new(self.ctx.level, &self.ctx);
match *tasc.expr { match *tasc.expr {
ast::Expr::Accessor(ast::Accessor::Ident(mut ident)) => { ast::Expr::Accessor(ast::Accessor::Ident(mut ident)) => {
log!(err "pylyzer_mode: {}", self.cfg.pylyzer_mode);
if self.cfg.pylyzer_mode { if self.cfg.pylyzer_mode {
ident.trim_end_proc_mark(); ident.trim_end_proc_mark();
} }
log!(err "{}", ident);
let py_name = Str::rc(ident.inspect().trim_end_matches('!')); let py_name = Str::rc(ident.inspect().trim_end_matches('!'));
let t = self.ctx.instantiate_typespec( let t = self.ctx.instantiate_typespec(
&tasc.t_spec, &tasc.t_spec,
@ -1936,9 +1938,11 @@ impl ASTLowerer {
Ok(hir::Expr::Accessor(hir::Accessor::Ident(ident)).type_asc(tasc.t_spec)) Ok(hir::Expr::Accessor(hir::Accessor::Ident(ident)).type_asc(tasc.t_spec))
} }
ast::Expr::Accessor(ast::Accessor::Attr(mut attr)) => { ast::Expr::Accessor(ast::Accessor::Attr(mut attr)) => {
log!(err "pylyzer_mode: {}", self.cfg.pylyzer_mode);
if self.cfg.pylyzer_mode { if self.cfg.pylyzer_mode {
attr.ident.trim_end_proc_mark(); attr.ident.trim_end_proc_mark();
} }
log!(err "{}", attr.ident);
let py_name = Str::rc(attr.ident.inspect().trim_end_matches('!')); let py_name = Str::rc(attr.ident.inspect().trim_end_matches('!'));
let t = self.ctx.instantiate_typespec( let t = self.ctx.instantiate_typespec(
&tasc.t_spec, &tasc.t_spec,