Skip to content

Add type restrictions to benchmark directory #15688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Vici37
Copy link
Contributor

@Vici37 Vici37 commented Apr 20, 2025

This is the output of compiling cr-source-typer and running it with the below incantation:

CRYSTAL_PATH="./src" ./typer spec/std_spec.cr --error-trace --exclude src/crystal/ --stats --progress --union-size-threshold 2 --ignore-private-defs src/benchmark

This is related to #15682 .

@@ -44,13 +44,13 @@ module Benchmark
end

# Reports a single benchmark unit.
def report(label = " ", &block)
def report(label : String = " ", &block) : Nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We could also add a restriction to the block parameter.

Suggested change
def report(label : String = " ", &block) : Nil
def report(label : String = " ", &block : ->) : Nil

@straight-shoota straight-shoota added this to the 1.18.0 milestone Aug 5, 2025
@straight-shoota straight-shoota changed the title Add missing type restrictions to benchmark directory Add type restrictions to benchmark directory Aug 7, 2025
@straight-shoota straight-shoota merged commit 9c7e8d9 into crystal-lang:master Aug 7, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants