-
-
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
Bytes[1, 2] is broken when used in a class #5343
Comments
class Foo(T)
macro [](*foo)
{% puts T %}
end
end
alias FooInt32 = Foo(Int32)
class Bar
def self.foo
FooInt32[1, 2, 3]
end
end
p FooInt32[1, 2, 3]
# => Int32
p Bar.foo
# compilation error: undefined constant T It means there is a bug about type aliases and macros. |
makenowjust
added a commit
to makenowjust/crystal
that referenced
this issue
Dec 5, 2017
makenowjust
added a commit
to makenowjust/crystal
that referenced
this issue
Dec 5, 2017
makenowjust
added a commit
to makenowjust/crystal
that referenced
this issue
Dec 6, 2017
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://carc.in/#/r/36qg
Gives:
The macro expansion is looking for a
T
in Foo.This is visible with this example (https://carc.in/#/r/36qi):
Going back in time with carc.in, it seems to break on 0.19.0 release.
The text was updated successfully, but these errors were encountered: