错误:没有重载'Log::Context.new'与类型(数组(字符串)|无)



我确实通过官方 docker 镜像更新到 crystal 0.35.1。不幸的是,我的项目在晶体本身的某个地方出现编译错误 错误:没有重载将"日志::上下文.new"与类型(数组(字符串(|无(。

root@395e51d80ee6:/app# crystal spec --error-trace
In /usr/share/crystal/src/log/entry.cr:43:35
43 | getter context : Metadata = Log.context.metadata
^------
Error: instantiating 'Log.class#context()'

In /usr/share/crystal/src/log/main.cr:56:18
56 | Log::Context.new(Fiber.current.logging_context)
^--
Error: no overload matches 'Log::Context.new' with type (Array(String) | Nil)
Overloads are:
- Log::Context.new(metadata : Metadata)
Nil trace:
/usr/share/crystal/src/log/main.cr:56
Log::Context.new(Fiber.current.logging_context)
^~~~~~~~~~~~~~~
macro property (in expanded macro: macro_140471448844816:630):6
def logging_context : Array(String) | ::Nil
^~~~~~~~~~~~~~~
macro property (in expanded macro: macro_140471448844816:630):7
@logging_context

macro property (in expanded macro: macro_140471448844816:630):4
@logging_context : Array(String) | ::Nil

我的水晶版本是

croot@395e51d80ee6:/app# crystal -v
Crystal 0.35.1 [5999ae29b] (2020-06-19)
LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu

我的编译被require "sidekiq"破坏了(看起来分片不再维护了(,我切换到require "mosquito".IMO 水晶编译器应在回溯中显示问题的直接根过程。

最新更新