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

Super wonky compile error when using "settings" instead of "setting" #78

Open
jwoertink opened this issue Feb 26, 2022 · 0 comments
Open
Labels
improve error experience Make errors nicer to deal with

Comments

@jwoertink
Copy link
Member

This code:

MyHabitatThing.create do
  settings anything : String
end

Causes this error:

There was a problem expanding macro 'create_settings_methods'

Code in macro 'finished'

 1 | Habitat.create_settings_methods(MyHabitatThing)
     ^
Called macro defined in lib/habitat/src/habitat.cr:239:3

 239 | macro create_settings_methods(type_with_habitat)

Which expanded to:

 >  8 | # Generates a hash using the provided values
 >  9 | def self.to_h
 > 10 |   {
          ^
Error: for empty hashes use '{} of KeyType => ValueType'

@jwoertink jwoertink added the improve error experience Make errors nicer to deal with label Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve error experience Make errors nicer to deal with
Projects
None yet
Development

No branches or pull requests

1 participant