使用未定义作为呼叫堆的do会导致编译器错误?

问题描述 投票:0回答:1
let ?callStack = undefined in undefined

引起了编译器的恐慌:

panic! (the 'impossible' happened)
  GHC version 9.10.1:
    refineFromInScope
  InScope {wild_00}
  $dIP_a79b
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:190:37 in ghc-9.10.1-2e29:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Opt/Simplify/Env.hs:931:30 in ghc-9.10.1-2e29:GHC.Core.Opt.Simplify.Env
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/Utils/Error.hs:507:29 in ghc-9.10.1-2e29:GHC.Utils.Error


Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
这确实是一个编译器错误,还是它打算?

	

尽管我不是GHC专家,但我可以说这里肯定有一个GHC错误。您遇到的行为是GHC错误,在这种情况下,请报告;否则GHC错误地打印了一条消息,通知您有一个GHC错误,这本身就是一个错误。

通常,任何告诉您的程序都必须在逻辑上是正确的。
haskell compiler-errors ghc callstack implicit-parameters
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.