Code below should produce a compiler error, but it doesn't:
module ExceptionTag
end
# This definition breaks things
class TaggedException < Exception
include ExceptionTag
end
arr = [] of Exception.class
arr << ExceptionTag
Removing TaggedException class definition makes it error out as expected:
Error in line 5: no overload matches 'Array(Exception:Class)#<<' with type ExceptionTag:Module
Overloads are:
- Array(T)#<<(value : T)
I suspect bug is somewhere inside Crystal::Call#lookup_matches_in_type, WDYT @asterite?
@Sija More like in restrictions.cr
@asterite You nailed it again, your compiler-pr-foo is strong! 鉂わ笍
Most helpful comment
@asterite You nailed it again, your compiler-pr-foo is strong! 鉂わ笍