-
-
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
[Interpeter] BUG: called llvm_struct_type for (Log::ShortColorFormat | TestFormat) (Exception) #12123
Comments
@I3oris new issue I ran into with |
Reduced!: require "log"
abstract struct Parent
extend Log::Formatter
def self.format(entry, io) : Nil
new
end
end
struct Child1 < Parent
end
struct Child2 < Parent
end But it could surely be reduced more by going through
The bug doesn't happen if Hope this help :) |
After unfolding the module Formatter
end
abstract struct Parent
extend Formatter
def self.format
new
end
end
struct Child1 < Parent
end
struct Child2 < Parent
end
class Backend
def initialize(@formatter : Formatter = Child1)
end
def write
@formatter.format
end
end
Backend.new.write It seems when calling |
In fact, it's weird that is
However that was the equivalent of what is in the log API. Maybe a bug here ?, or it's a property of Lines 12 to 14 in b7377c0
|
I looked into it a bit. It's because we are missing handling virtual struct types in the interpreter. I'll probably fix it later this week. |
I'm playing around with I3oris/ic on my largest project to see what edge cases I can run into.
ic
is a bit ahead of crystal's interpreter as it has the change from #12061 merged already, and this bug only appears after that one is fixed. Thankfully, this bug comes from one of my shards I've split out, so I have a simple reproducer below.Stack trace:
Reproducing:
The shard is largely a reproduction of ShortFormat but with color configuration support added (I thought it looked a little bland).
The text was updated successfully, but these errors were encountered: