Skip to content

Commit

Permalink
Pass docs through type def annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Dec 19, 2024
1 parent b35c9bb commit fb52146
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/crystal/semantic/top_level_visitor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ class Crystal::TopLevelVisitor < Crystal::SemanticVisitor
end

def visit(node : TypeDef)
annotations = read_annotations
type = current_type.types[node.name]?

if type
Expand All @@ -650,7 +651,7 @@ class Crystal::TopLevelVisitor < Crystal::SemanticVisitor
typed_def_type = check_allowed_in_lib node.type_spec, typed_def_type
type = TypeDefType.new @program, current_type, node.name, typed_def_type

attach_doc type, node, nil
attach_doc type, node, annotations

current_type.types[node.name] = type
end
Expand Down

0 comments on commit fb52146

Please sign in to comment.