Skip to content

Add type restrictions to regex directory#16066

Merged
straight-shoota merged 7 commits intocrystal-lang:masterfrom
Vici37:add-type-restrictions-to-regex
Dec 4, 2025
Merged

Add type restrictions to regex directory#16066
straight-shoota merged 7 commits intocrystal-lang:masterfrom
Vici37:add-type-restrictions-to-regex

Conversation

@Vici37
Copy link
Contributor

@Vici37 Vici37 commented Aug 6, 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/regex

This is related to #15682 .

This is the output of compiling [cr-source-typer](https://github.com/Vici37/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/regex
```

This is related to crystal-lang#15682 .
@straight-shoota straight-shoota added this to the 1.18.0 milestone Aug 12, 2025
@straight-shoota straight-shoota removed this from the 1.18.0 milestone Aug 12, 2025
@straight-shoota straight-shoota self-requested a review December 1, 2025 22:04
Copy link
Collaborator

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

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

I'm wondering: while the added Int32 constraint makes sense, the actual value is never constrained in practice, so it can theoretically be any Int? 😞

@straight-shoota
Copy link
Member

I think Int32 makes sense. It is sufficient for all practical purposes. Using a concrete type avoids having multiple method overloads for different integer types.

@straight-shoota straight-shoota added this to the 1.19.0 milestone Dec 2, 2025
@straight-shoota straight-shoota merged commit 9af0735 into crystal-lang:master Dec 4, 2025
42 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.

5 participants