habitat icon indicating copy to clipboard operation
habitat copied to clipboard

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

Open jwoertink opened this issue 3 years ago • 0 comments

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 avatar Feb 26 '22 02:02 jwoertink