Skip to content

Instantly share code, notes, and snippets.

@straight-shoota
Created January 21, 2022 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save straight-shoota/935e23ef9eb24f0644cf4d0014db0473 to your computer and use it in GitHub Desktop.
Save straight-shoota/935e23ef9eb24f0644cf4d0014db0473 to your computer and use it in GitHub Desktop.
Crystal compiler error `--error-trace`
Using /home/linuxbrew/.linuxbrew/bin/llvm-config [version= 13.0.0]
In src/compiler/crystal/program.cr:45:69
 45 | getter splat_expansions : Hash(Def, Type) = ({} of Def => Type).compare_by_identity
^------------------
Error: instantiating 'Hash(Crystal::Def, Crystal::Type)#compare_by_identity()'
In src/hash.cr:976:5
 976 | rehash
^-----
Error: instantiating 'rehash()'
In src/hash.cr:1922:5
 1922 | do_compaction(rehash: true)
^------------
Error: instantiating 'do_compaction()'
In src/hash.cr:577:5
 577 | each_entry_with_index do |entry, entry_index|
^--------------------
Error: instantiating 'each_entry_with_index()'
In src/hash.cr:577:5
 577 | each_entry_with_index do |entry, entry_index|
^--------------------
Error: instantiating 'each_entry_with_index()'
In src/hash.cr:580:22
 580 | entry_hash = key_hash(entry.key)
^-------
Error: instantiating 'key_hash(Crystal::Def+)'
In src/hash.cr:914:18
 914 | hash = key.hash.to_u32!
^---
Error: instantiating 'Crystal::Def+#hash()'
In src/object.cr:86:5
 86 | hash(Crystal::Hasher.new).result
^---
Error: instantiating 'hash(Crystal::Hasher)'
In src/compiler/crystal/semantic/ast.cr:747:5
 747 | def_hash @real_name, @varargs, @fun_def
^
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = @real_name.hash(hasher)
 > 4 | 
 > 5 |  hasher = @varargs.hash(hasher)
 > 6 | 
 > 7 |  hasher = @fun_def.hash(hasher)
 > 8 | 
 > 9 |  hasher
 > 10 |  end
 > 11 | 
Error: instantiating '(Crystal::FunDef | Nil)#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals @name, @args, @return_type, @varargs, @body, @real_name
 > 2 |  def_hash @name, @args, @return_type, @varargs, @body, @real_name
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = @name.hash(hasher)
 > 4 | 
 > 5 |  hasher = @args.hash(hasher)
 > 6 | 
 > 7 |  hasher = @return_type.hash(hasher)
 > 8 | 
 > 9 |  hasher = @varargs.hash(hasher)
 > 10 | 
 > 11 |  hasher = @body.hash(hasher)
 > 12 | 
 > 13 |  hasher = @real_name.hash(hasher)
 > 14 | 
 > 15 |  hasher
 > 16 |  end
 > 17 | 
Error: instantiating 'Array(Crystal::Arg)#hash(Crystal::Hasher)'
In src/indexable.cr:746:21
 746 | hasher = elem.hash(hasher)
^---
Error: instantiating 'Crystal::Arg#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals name, default_value, restriction, external_name
 > 2 |  def_hash name, default_value, restriction, external_name
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = name.hash(hasher)
 > 4 | 
 > 5 |  hasher = default_value.hash(hasher)
 > 6 | 
 > 7 |  hasher = restriction.hash(hasher)
 > 8 | 
 > 9 |  hasher = external_name.hash(hasher)
 > 10 | 
 > 11 |  hasher
 > 12 |  end
 > 13 | 
Error: instantiating '(Crystal::ASTNode | Nil)#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals node, filename
 > 2 |  def_hash node, filename
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = node.hash(hasher)
 > 4 | 
 > 5 |  hasher = filename.hash(hasher)
 > 6 | 
 > 7 |  hasher
 > 8 |  end
 > 9 | 
Error: instantiating 'Crystal::ASTNode+#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals assign, restriction
 > 2 |  def_hash assign, restriction
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = assign.hash(hasher)
 > 4 | 
 > 5 |  hasher = restriction.hash(hasher)
 > 6 | 
 > 7 |  hasher
 > 8 |  end
 > 9 | 
Error: instantiating 'Crystal::Assign#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals @target, @value
 > 2 |  def_hash @target, @value
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = @target.hash(hasher)
 > 4 | 
 > 5 |  hasher = @value.hash(hasher)
 > 6 | 
 > 7 |  hasher
 > 8 |  end
 > 9 | 
Error: instantiating 'Crystal::ASTNode+#hash(Crystal::Hasher)'
There was a problem expanding macro 'def_equals_and_hash'
Called macro defined in src/object.cr:1376:3
 1376 | macro def_equals_and_hash(*fields)
Which expanded to:
 > 1 |  def_equals type
 > 2 |  def_hash type
 > 3 | 
Error: expanding macro
There was a problem expanding macro 'def_hash'
Called macro defined in src/object.cr:1325:3
 1325 | macro def_hash(*fields)
Which expanded to:
 > 1 |  def hash(hasher)
 > 2 | 
 > 3 |  hasher = type.hash(hasher)
 > 4 | 
 > 5 |  hasher
 > 6 |  end
 > 7 | 
Error: instantiating 'type()'
In src/compiler/crystal/semantic/to_s.cr:47:17
 47 | node.type.devirtualize.to_s(@str)
^-----------
Error: instantiating 'Crystal::Type+#devirtualize()'
In src/compiler/crystal/types.cr:273:24
 273 | self.base_type.metaclass
^--------
Error: instantiating 'Crystal::Type+#metaclass()'
In src/compiler/crystal/types.cr:122:33
 122 | metaclass = MetaclassType.new(program, self)
^--
Error: instantiating 'Crystal::MetaclassType.class#new(Crystal::Program, Crystal::Type+)'
In src/compiler/crystal/types.cr:2790:5
 2790 | def initialize(program, @instance_type : Type, super_class = nil, name = nil)
^---------
Error: instantiating 'initialize(Crystal::Program, Crystal::Type+, Nil, Nil)'
In src/compiler/crystal/types.cr:2794:38
 2794 | program.enum.metaclass
^--------
Error: instantiating 'Crystal::NonGenericClassType#metaclass()'
In src/compiler/crystal/types.cr:122:33
 122 | metaclass = MetaclassType.new(program, self)
^--
Error: instantiating 'Crystal::MetaclassType.class#new(Crystal::Program, Crystal::NonGenericClassType)'
In src/compiler/crystal/types.cr:2790:5
 2790 | def initialize(program, @instance_type : Type, super_class = nil, name = nil)
^---------
Error: instantiating 'initialize(Crystal::Program, Crystal::NonGenericClassType, Nil, Nil)'
In src/compiler/crystal/types.cr:2805:7
 2805 | super(program, program, name, super_class)
^----
Error: instantiating 'super(Crystal::Program, Crystal::Program, String, Crystal::Type+)'
In src/compiler/crystal/types.cr:1195:5
 1195 | def initialize(program, namespace, name, @superclass, add_subclass = true)
^---------
Error: instantiating 'initialize(Crystal::Program, Crystal::Program, String, Crystal::Type+, Bool)'
In src/compiler/crystal/types.cr:1199:7
 1199 | force_add_subclass if add_subclass
^-----------------
Error: instantiating 'force_add_subclass()'
In src/compiler/crystal/types.cr:1221:18
 1221 | superclass.try &.add_subclass(self)
^--
Error: instantiating '(Crystal::Type | Nil)#try()'
In src/compiler/crystal/types.cr:1221:18
 1221 | superclass.try &.add_subclass(self)
^--
Error: instantiating '(Crystal::Type | Nil)#try()'
In src/compiler/crystal/types.cr:1221:24
 1221 | superclass.try &.add_subclass(self)
^-----------
Error: instantiating 'Crystal::Type+#add_subclass(Crystal::MetaclassType)'
In src/compiler/crystal/types.cr:2051:7
 2051 | notify_subclass_added
^--------------------
Error: instantiating 'notify_subclass_added()'
In src/compiler/crystal/types.cr:1024:27
 1024 | @subclass_observers.try &.dup.each &.on_new_subclass
^--
Error: instantiating '(Array(Crystal::Call) | Nil)#try()'
In src/compiler/crystal/types.cr:1024:27
 1024 | @subclass_observers.try &.dup.each &.on_new_subclass
^--
Error: instantiating '(Array(Crystal::Call) | Nil)#try()'
In src/compiler/crystal/types.cr:1024:44
 1024 | @subclass_observers.try &.dup.each &.on_new_subclass
^--------------
Error: instantiating 'Crystal::Call#on_new_subclass()'
In src/compiler/crystal/semantic/call.cr:726:5
 726 | recalculate
^----------
Error: instantiating 'recalculate()'
In src/compiler/crystal/semantic/call.cr:91:15
 91 | matches = lookup_matches
^-------------
Error: instantiating 'lookup_matches()'
In src/compiler/crystal/semantic/call.cr:119:5
 119 | lookup_matches(with_autocast: false)
^-------------
Error: instantiating 'lookup_matches()'
In src/compiler/crystal/semantic/call.cr:126:7
 126 | lookup_matches_with_splat(with_autocast)
^------------------------
Error: instantiating 'lookup_matches_with_splat(Bool)'
In src/compiler/crystal/semantic/call.cr:190:5
 190 | lookup_matches_without_splat arg_types, named_args_types, with_autocast: with_autocast
^---------------------------
Error: instantiating 'lookup_matches_without_splat(Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil))'
In src/compiler/crystal/semantic/call.cr:195:7
 195 | lookup_matches_in(obj.type, arg_types, named_args_types, with_autocast: with_autocast)
^----------------
Error: instantiating 'lookup_matches_in(Crystal::Type+, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil))'
In src/compiler/crystal/semantic/call.cr:207:3
 207 | def lookup_matches_in(owner : AliasType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_autocast = false)
^----------------
Error: instantiating 'lookup_matches_in(Crystal::AliasType, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil), Nil, String, Bool, Bool)'
In src/compiler/crystal/semantic/call.cr:208:5
 208 | lookup_matches_in(owner.remove_alias, arg_types, named_args_types, search_in_parents: search_in_parents, with_autocast: with_autocast)
^----------------
Error: instantiating 'lookup_matches_in(Crystal::Type+, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil))'
In src/compiler/crystal/semantic/call.cr:211:3
 211 | def lookup_matches_in(owner : UnionType, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_autocast = false)
^----------------
Error: instantiating 'lookup_matches_in(Crystal::UnionType+, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil), Nil, String, Bool, Bool)'
In src/compiler/crystal/semantic/call.cr:212:41
 212 | owner.union_types.flat_map { |type| lookup_matches_in(type, arg_types, named_args_types, search_in_parents: search_in_parents, with_autocast: with_autocast) }
^----------------
Error: instantiating 'lookup_matches_in(Crystal::Type+, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil))'
In src/compiler/crystal/semantic/call.cr:215:3
 215 | def lookup_matches_in(owner : Program, arg_types, named_args_types, self_type = nil, def_name = self.name, search_in_parents = true, with_autocast = false)
^----------------
Error: instantiating 'lookup_matches_in(Crystal::Program, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil), Nil, String, Bool, Bool)'
In src/compiler/crystal/semantic/call.cr:216:5
 216 | lookup_matches_in_type(owner, arg_types, named_args_types, self_type, def_name, search_in_parents: search_in_parents, with_autocast: with_autocast)
^---------------------
Error: instantiating 'lookup_matches_in_type(Crystal::Program, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil), Nil, String)'
In src/compiler/crystal/semantic/call.cr:260:3
 260 | def lookup_matches_in_type(owner, arg_types, named_args_types, self_type, def_name, search_in_parents, search_in_toplevel = true, with_autocast = false)
^---------------------
Error: instantiating 'lookup_matches_in_type(Crystal::Program, Array(Crystal::Type), (Array(Crystal::NamedArgumentType) | Nil), Nil, String, Bool, Bool, Bool)'
In src/compiler/crystal/semantic/call.cr:311:5
 311 | instantiate signature, matches, owner, self_type, with_autocast
^----------
Error: instantiating 'instantiate(Crystal::CallSignature, Crystal::Matches, Crystal::Program, Nil, Bool)'
In src/compiler/crystal/semantic/call.cr:369:13
 369 | matches.each do |match|
^---
Error: instantiating 'Crystal::Matches#each()'
In src/compiler/crystal/semantic/match.cr:152:28
 152 | @success && @matches.try &.each do |match|
^--
Error: instantiating '(Array(Crystal::Match) | Nil)#try()'
In src/compiler/crystal/semantic/match.cr:152:28
 152 | @success && @matches.try &.each do |match|
^--
Error: instantiating '(Array(Crystal::Match) | Nil)#try()'
In src/compiler/crystal/semantic/call.cr:369:13
 369 | matches.each do |match|
^---
Error: instantiating 'Crystal::Matches#each()'
In src/compiler/crystal/semantic/call.cr:372:36
 372 | yield_vars, block_arg_type = match_block_arg(match)
^--------------
Error: instantiating 'match_block_arg(Crystal::Match)'
In src/compiler/crystal/semantic/call.cr:953:40
 953 | block_arg_type = program.proc_of(fun_args, 1)
^------
Error: no overload matches 'Crystal::Program#proc_of' with types Array(Crystal::Arg), Int32
Overloads are:
- Crystal::Program#proc_of(nodes : Array(ASTNode), return_type : Type)
- Crystal::Program#proc_of(types : Array)
make: *** [Makefile:193: .build/crystal] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment