Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some namespaced class hierarchies are not realizable #89

Open
HertzDevil opened this issue Sep 7, 2020 · 0 comments
Open

Some namespaced class hierarchies are not realizable #89

HertzDevil opened this issue Sep 7, 2020 · 0 comments

Comments

@HertzDevil
Copy link
Contributor

In Crystal every class must be defined after all of its base classes, but #83 now permits certain class hierarchies that cannot be realized by the current Bindgen generators, because they require reopening a namespace:

namespace N {
  struct A { };
}

struct B : N::A { };

namespace N {
  struct C : B { };
}
# `N::A` is not defined here
class B < N::A end

module N
  class A end
  class C < B end
end
module N
  class A end
  # `B` is not defined here
  class C < B end
end

class B < N::A end

This rarely occurs in real code; a full fix might require a complete rewrite of Graph::Container and friends, since they impose similar restrictions on the node visitation order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant