-
I noticed that backtraces are not visible during exceptions unless --debug mode is enabled. However, when I try to enable --debug for my application, I encounter an issue. This problem can be reproduced using marten_cli as well. `crystal build --debug src/marten_cli.cr`$ crystal build --debug src/marten_cli.cr
BUG: called create_llvm_type for M (Exception)
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'raise<Exception>:NoReturn'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'raise<String>:NoReturn'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_type<Crystal::Type+, Bool>:NoReturn'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_type<Crystal::Type+, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_type<Crystal::PointerInstanceType, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_type<Crystal::Type+, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_type<Crystal::Type+, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_type<Crystal::Type+, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_type<Crystal::Type+, Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#create_llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::LLVMTyper#llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::NilableReferenceUnionType | Crystal::ReferenceUnionType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<Crystal::MixedUnionType, Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<Crystal::PointerInstanceType, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<Crystal::PointerInstanceType, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<Crystal::PointerInstanceType, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_debug_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Crystal::Type+>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#get_debug_type<Crystal::Type+, Crystal::Type+>:(LibLLVM::MetadataRef | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#codegen_fun<String, Crystal::Def+, Crystal::Type+, Bool, Crystal::CodeGenVisitor::ModuleInfo, Bool, Bool>:Crystal::LLVMTypedFunction'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#target_def_fun<Crystal::Def+, Crystal::Type+>:Crystal::LLVMTypedFunction'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::Call>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#create_initialize_class_var_function<Crystal::MetaTypeVar, Crystal::ClassVarInitializer>:(Crystal::LLVMTypedFunction | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#initialize_class_var<Crystal::MetaTypeVar>:(LLVM::Value | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::ClassDef>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::ModuleDef>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::ModuleDef>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::ModuleDef>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::FileNode>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::FileNode>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::CodeGenVisitor#visit<Crystal::Expressions>:Bool'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::CodeGenVisitor>:Nil'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:Array(Crystal::Compiler::CompilationUnit)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::Command#run:(Bool | Crystal::Repl::Value | Nil)'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in '__crystal_main'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32'
from /opt/homebrew/Cellar/crystal/1.15.1/bin/crystal in 'main'
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues As I understand, this is a common issue in Crystal that requires improvements in type detection or macro handling. |
Beta Was this translation helpful? Give feedback.
Answered by
ellmetha
Mar 23, 2025
Replies: 1 comment
-
Hey! I believe this is the same issue as #219. And yes, it appears to be an issue with Crystal. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
miry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! I believe this is the same issue as #219. And yes, it appears to be an issue with Crystal.