-
-
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
BUG: `def consume_formatted_substitution ... at .../string/formatter.cr:53:11 has no type #7461
Comments
Am able to easily reproduce it. Working on trimming it down atm. The error message is slightly different on Mac.
|
Reduced: https://play.crystal-lang.org/#/r/6bgt require "crypto/bcrypt/password"
class FooHandler
def initialize
proc = ->(vals : Hash(String, String?)) do
->{Crypto::Bcrypt::Password.create("monkey").to_s }.call
end
end
end
def run(handlers : Array(FooHandler) = [FooHandler.new])
end
run s/o to @konovod for a further reduction. |
Reduced a bit more: class Foo
def initialize
"" % 1
end
end
def run(x : Foo = Foo.new)
end
run Probably can be reduced further by starting to reduce |
Got stack trace to display differently again if its helpful for anything
|
@asterite I don't really know what im doing but adding |
Reduced more: lib LibC
fun exit(Int32) : NoReturn
end
class Foo
def initialize
arg = 1
LibC.exit(0) unless arg.is_a?(String)
unknown arg
end
end
def run(x : Foo = Foo.new)
end
run It's strange because if you remove the |
Bumping to say that I just ran into this. I can run |
Same behavior seen |
I have tested Crystal versions 1.5.2 to 1.8.1 and this |
For folks discovering this issue because you're seeing this error in your specs and need a workaround: Some calls in the |
…itution` This is a workaround for a compiler error that fails to type this method (crystal-lang#7461).
Adding a I disagree on this reasoning for rejecting a workaround in #7474 (comment)
Yes it's a compiler bug. But it affects people using stdlib features. We haven't managed to identify, let alone fix, the cause of this bug in 5 years. So leaving it unpatched hasn't helped finding a proper solution. The least we can do is apply a simple workaround to make this smooth for stdlib API consumers. |
Unfortunately at this point I'm not sure what that code was :/ |
error:
I do not have code that can reproduce it atm. Came across it while i was writing a tutorial for Athena + Granite. I can share the repo once its done if anyone wants to poke around.
The issue seems to be with something Athena is doing. I'll poke around later and see if i can figure anything out.
The text was updated successfully, but these errors were encountered: