Skip to content

Fix enable docs for builtin constants#14571

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/doc-generator-builtin-constants
May 9, 2024
Merged

Fix enable docs for builtin constants#14571
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/doc-generator-builtin-constants

Conversation

@straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented May 7, 2024

The builtins are created inside the initializer. At this point wants_doc? is always false becase the doc generator only set it to true after the initializer.

I don't think there's any noticable impact from having a dozend doc strings assigned in every program AST, even without wants_doc. Skipping docs is an optimization that pays out when parsing huge program ASTs. But for these few doc strings, there shouldn't be any issue.
The doc strings are literals, so they don't even occupy any memory (not that it would hurt much if it did).

Follow-up to #14276

The builtins are created inside the initializer. At this point
`wants_doc?` is always `false` becase it is only assigned after the
initializer.
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime labels May 7, 2024
@straight-shoota straight-shoota self-assigned this May 7, 2024
@straight-shoota straight-shoota added this to the 1.13.0 milestone May 7, 2024
@straight-shoota straight-shoota merged commit 440a795 into crystal-lang:master May 9, 2024
@straight-shoota straight-shoota deleted the fix/doc-generator-builtin-constants branch May 9, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants