简体   繁体   中英

Unexpected Indent error coffeescript

I get an unexpected indent error when I try compiling this code:

class permanentItem extend Item 
    add: ->
        super()

    remove: ->
        super()

It is on the second line add: -> . I have tried commenting that and it still gives me the same error on remove: -> . Any ideas?

You have a typo in your code. It should be extends instead of extend :

class permanentItem extends Item 
    add: ->
        super()

    remove: ->
        super()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM