-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Strange scope error #767
Comments
I've been trying to reduce your code but noticed that you sometimes do: module Amethyst
module Middleware
require "./*"
end
end One of the middleware does One solution, if you want to avoid repeating all the Another solution is to just use the |
Didn't we want to get rid of the renamespacing through require? |
Yes, I was thinking that maybe we can make |
Yeah, let's do that, I think it comes with fewer surprises. |
And actually I wouldn't mind disallowing it anywhere outside the toplevel. |
If require doesn't do renamespacing then I'd definitely agree disallowing it outside the top level makes most sense. It would be nice to have some way of renamespacing though. |
@asterite thanks for work, got it. So, it is better to avoid of renamespacing? Maybe there can be option to create aliases for namespaces like |
You can use renamespacing, it works. Maybe it's particularly useful with You can already use an alias: |
@asterite thank you for help =) |
I'll close this issue for now. If you want to open an RFC for how |
Have such code:
When running specs, got next error:
For some weird reason, Crystal determines type of
cookies_hash = {} of String => String
asHash(Amethyst::Middleware::String, Amethyst::Middleware::String)
, but I have not such classes! This error appeared while using this library. You can see full code at separate branch I created at my repository (run files atexamples
orspecs
directory).The text was updated successfully, but these errors were encountered: