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

a[]b ++ c fails to compile #542

Closed
quarterto opened this Issue Aug 12, 2014 · 5 comments

Comments

Projects
None yet
6 participants
@quarterto
Contributor

quarterto commented Aug 12, 2014

Unexpected ','

@duralog

This comment has been minimized.

duralog commented Aug 14, 2014

can you explain what you expected the output to be? I'm pretty sure that's wrong... you have not said your index. a[0]b ++ c will compile

@normalser

This comment has been minimized.

normalser commented Aug 14, 2014

There is nothing wrong with what @quarterto is trying to do.
It should compile to (a.b || (a.b = [])).concat(c)

@quarterto

This comment has been minimized.

Contributor

quarterto commented Aug 14, 2014

Search for "semiautovivification" in the docs. a[]b ensures b exists as an array on a.

@duralog

This comment has been minimized.

duralog commented Aug 16, 2014

wow! you are right... that should exist... however in my opinion it actually should not.. because it's one thong to say x instanceof MyObj and another thing to say typeoof x === 'object' -- so I would actually like this syntax to be kiiled for obvious reasons

@vendethiel

This comment has been minimized.

Contributor

vendethiel commented Sep 14, 2014

Also, a[]b + c works.

@gkz gkz added the bug label Apr 17, 2015

@isiahmeadows isiahmeadows referenced this issue Jun 5, 2016

Closed

So-called "next big version" #811

0 of 8 tasks complete

@pepkin88 pepkin88 referenced this issue Mar 26, 2018

Merged

Fix for #542 #1026

@rhendric rhendric closed this Aug 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment