diff --git a/src/compiler/crystal/semantic/call.cr b/src/compiler/crystal/semantic/call.cr index e265829a919e..1fa4379d543e 100644 --- a/src/compiler/crystal/semantic/call.cr +++ b/src/compiler/crystal/semantic/call.cr @@ -13,10 +13,8 @@ class Crystal::Call property? uses_with_scope = false class RetryLookupWithLiterals < ::Exception - @@dummy_call_stack = Exception::CallStack.new - def initialize - self.callstack = @@dummy_call_stack + self.callstack = Exception::CallStack.empty end end diff --git a/src/exception/call_stack.cr b/src/exception/call_stack.cr index c80f73a6ce48..09173f2e5500 100644 --- a/src/exception/call_stack.cr +++ b/src/exception/call_stack.cr @@ -31,8 +31,11 @@ struct Exception::CallStack @callstack : Array(Void*) @backtrace : Array(String)? - def initialize - @callstack = CallStack.unwind + def initialize(@callstack : Array(Void*) = CallStack.unwind) + end + + def self.empty + new([] of Void*) end def printable_backtrace : Array(String)