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

issues with class inheriting from context #47

Open
cooper opened this issue Mar 1, 2017 · 3 comments
Open

issues with class inheriting from context #47

cooper opened this issue Mar 1, 2017 · 3 comments
Labels

Comments

@cooper
Copy link
Owner

cooper commented Mar 1, 2017

I've always wanted class to inherit from context since you can extend a class with the package keyword just as you can a context, but it causes problems.

I made it so Class inherits from Context now, which is working OK, except that I had to tweak something in Function.pm. I had to use the actual outer scope of the function rather than the nearest context. This is undesirable because it would allow function type checks to be blinded by lexical variables or nested functions having the same name as the type.

@cooper cooper added the bug label Mar 1, 2017
@cooper
Copy link
Owner Author

cooper commented Mar 1, 2017

by "problems" I mean that it gets stuck in an infinite loop during initialization

@cooper
Copy link
Owner Author

cooper commented Mar 2, 2017

I reverted it to the way it was. Classes no longer inherit from context, the function type resolving is fixed. I still want them to though.

@cooper
Copy link
Owner Author

cooper commented Mar 2, 2017

Since classes are not contexts, this happens with the new autoloading checks:

2:36:50 PM <booby> Class 'Vector' { ?$items:Num... }
2:36:55 PM <~mad> error in Math/build/Vector.frt.pm: Couldn't find Math::VectorAxis|VectorAxis at /Users/mitchellcooper/Projects/ferret/lib/Ferret/Core/FF.pm line 69.

This is because it's checking Math::VectorAxis and VectorAxis but NOT Math::Vector::VectorAxis (which is where it actually exists). It only looks for the package name, not the class.

cooper added a commit that referenced this issue Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant