Skip to content
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

Corrected missing return value in the FileInfo flags method #6248

Merged
merged 1 commit into from Jun 24, 2018
Merged

Corrected missing return value in the FileInfo flags method #6248

merged 1 commit into from Jun 24, 2018

Conversation

fgimian
Copy link
Contributor

@fgimian fgimian commented Jun 23, 2018

Hey guys,

Reproduction of this problem I just discovered:

icr(0.25.0) > File.info("Zebra2_28_7422_Mac.zip").flags
Error in .icr_CTWDYWE1dyvsCD6uVxiy-Q.cr:17: instantiating '__icr_exec__()'

puts "|||YIH22hSkVQN|||#{__icr_exec__.inspect}"
                         ^~~~~~~~~~~~

in .icr_CTWDYWE1dyvsCD6uVxiy-Q.cr:12: instantiating 'Crystal::System::FileInfo#flags()'

  File.info("Zebra2_28_7422_Mac.zip").flags
                                      ^~~~~

in /usr/local/Cellar/crystal-lang/0.25.0/src/crystal/system/unix/file_info.cr:34: type must be File::Flags, not (File::Flags | Nil)

  def flags : ::File::Flags
      ^~~~~

Rerun with --error-trace to show a complete error trace.

This method was simply missing a return value.

Cheers
Fotis

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

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

Oops, my bad

@RX14 RX14 added this to the 0.25.1 milestone Jun 23, 2018
@asterite
Copy link
Member

The bad side of type inference on method instantiation.

@ysbaddaden ysbaddaden merged commit e4a01b5 into crystal-lang:master Jun 24, 2018
@fgimian
Copy link
Contributor Author

fgimian commented Jun 24, 2018

Thanks for the merge folks 😄

@straight-shoota
Copy link
Member

It looks like this could also use a spec...

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.

None yet

7 participants