Update lower.rs

This commit is contained in:
Shunsuke Shibayama 2022-12-17 12:10:08 +09:00
parent 8a7469cb09
commit e7d82ecf4a

View file

@ -1291,7 +1291,12 @@ impl ASTLowerer {
)));
}
let kind = ContextKind::MethodDefs(impl_trait.as_ref().map(|(t, _)| t.clone()));
self.ctx.grow(&class.local_name(), kind, Private, None);
let vis = if self.cfg.python_compatible_mode {
Public
} else {
Private
};
self.ctx.grow(&class.local_name(), kind, vis, None);
for attr in methods.attrs.iter_mut() {
match attr {
ast::ClassAttr::Def(def) => {