segecey / hoop

Building native OSX apps.
196 stars 9 forks source link

Doesn't run in Crystal 0.20.0 #13

Closed aemadrid closed 7 years ago

aemadrid commented 7 years ago

Error while trying to run an example (all examples fail):


$ crystal run example/ns_log_test.cr
Error in example/ns_log_test.cr:1: while requiring "./../src/hoop"

require "./../src/hoop"
^

in src/hoop.cr:2: while requiring "./foundation/*"

require "./foundation/*"
^

in src/foundation/calayer.cr:1: while requiring "./nsobject"

require "./nsobject"
^

in src/foundation/nsobject.cr:306: expanding macro

    objc_method "retain"
    ^

in macro 'objc_method' /Users/aemadrid/code/aem/crystal/hoop/src/foundation/nsobject.cr:185, line 2:

   1.
>  2.         objc_method_helper(self.to_objc, "retain", nil, nil, nil)
   3.
   4.

expanding macro
in src/foundation/nsobject.cr:40: can't execute OpAssign in a macro

      {{ "##{crystal_method ||= method_name}".id }}
             ^

aemadrid at cortazar in ~/code/aem/crystal/hoop (master●●)
$ crystal -v
Crystal 0.20.0 (2016-11-22)```
zlwaterfield commented 7 years ago

Same issue as @aemadrid on v0.20.1

nareiber commented 7 years ago

This is how I cleaned up those lazy assignments. https://github.com/nareiber/hoop/commit/90b437cb0c01df589004d516b3949870b10490e0

segecey commented 7 years ago

Fixed. Thanks to @nareiber

nareiber commented 7 years ago

Glad to be of some help. I'm still a crystal noob, but I'm learning. Thank you for creating these easy to use bindings!