Skip to content

Add type restrictions to Dir#15697

Merged
straight-shoota merged 2 commits intocrystal-lang:masterfrom
Vici37:add-type-restrictions-to-dir
Apr 30, 2025
Merged

Add type restrictions to Dir#15697
straight-shoota merged 2 commits intocrystal-lang:masterfrom
Vici37:add-type-restrictions-to-dir

Conversation

@Vici37
Copy link
Contributor

@Vici37 Vici37 commented Apr 21, 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 \
  --ignore-protected-defs \
  src/dir

This is related to #15682 .

src/dir/glob.cr Outdated
record ConstantEntry, path : String, merged : Bool
record EntryMatch, pattern : String do
def matches?(string) : Bool
def matches?(string : String) : Bool
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: This entire type is an internal implementation detail. I don't think a type restriction matters here.

src/dir/glob.cr Outdated
record RootDirectory
record DirectoryMatch, pattern : String do
def matches?(string) : Bool
def matches?(string : String) : Bool
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@straight-shoota straight-shoota added this to the 1.17.0 milestone Apr 24, 2025
@straight-shoota straight-shoota changed the title Add type restrictions to Dir directory Add type restrictions to Dir Apr 30, 2025
@straight-shoota straight-shoota merged commit 64a773a into crystal-lang:master Apr 30, 2025
34 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