From fb521465b4c46ac6717939575243810afef3bca3 Mon Sep 17 00:00:00 2001 From: Margret Riegert Date: Thu, 19 Dec 2024 14:30:51 -0500 Subject: [PATCH] Pass docs through type def annotations --- src/compiler/crystal/semantic/top_level_visitor.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/crystal/semantic/top_level_visitor.cr b/src/compiler/crystal/semantic/top_level_visitor.cr index c71444da4042..799cfc0d947c 100644 --- a/src/compiler/crystal/semantic/top_level_visitor.cr +++ b/src/compiler/crystal/semantic/top_level_visitor.cr @@ -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 @@ -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