Skip to content

Commit fb52146

Browse files
Pass docs through type def annotations
1 parent b35c9bb commit fb52146

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/crystal/semantic/top_level_visitor.cr

+2-1
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ class Crystal::TopLevelVisitor < Crystal::SemanticVisitor
641641
end
642642

643643
def visit(node : TypeDef)
644+
annotations = read_annotations
644645
type = current_type.types[node.name]?
645646

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

653-
attach_doc type, node, nil
654+
attach_doc type, node, annotations
654655

655656
current_type.types[node.name] = type
656657
end

0 commit comments

Comments
 (0)