oilshell / oil

Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
http://www.oilshell.org/
Other
2.78k stars 150 forks source link

mycpp: avoid subclass name colissions #1978

Closed melvinw closed 1 month ago

melvinw commented 1 month ago

Subclass names can collide, e.g. builtin.func_misc.Type and builtin.meta_osh.Type which share the base core.vm._Callable. This isn't a big deal until you need to query the subclass->base relationship, which a future commit will do.

This commit also changes pass_state.Virtual.virtuals into a mapping from (class, method) -> (base, method). If an entry maps to None that means the given method is part of the base class. This will allow a future commit to find the base for a given subclass.

The commit also changes mycpp to use fully-qualified class names when interacting with pass_state.Virtual to avoid ambiguity.