Skip to content

Commit

Permalink
Fix crystal tool implementations and crystal tool context as well
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Oct 7, 2024
1 parent d2305f8 commit 7ccd867
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/crystal/tools/typed_def_processor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ module Crystal::TypedDefProcessor
end

private def process_type(type : Type) : Nil
# Avoid visiting circular hierarchies. There's no use in processing
# alias types anyway.
# For example:
#
# struct Foo
# alias Bar = Foo
# end
return if type.is_a?(AliasType) || type.is_a?(TypeDefType)

if type.is_a?(NamedType) || type.is_a?(Program) || type.is_a?(FileModule)
type.types?.try &.each_value do |inner_type|
process_type inner_type
Expand Down

0 comments on commit 7ccd867

Please sign in to comment.