DanielXMoore / Civet

A TypeScript superset that favors more types and less typing

Home Page:https://civet.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attempted pattern matching ternary

bbrk24 opened this issue · comments

undo := => engine = Engine.fromJSON json if json? := history.pop()
const undo = () =>(const json? = history.pop()? engine = Engine.fromJSON(json):void 0)

Workaround: put the function body on the next line

undo := =>
  engine = Engine.fromJSON json if json? := history.pop()

A workaround for now:

undo := =>
  engine = Engine.fromJSON json if json? := history.pop()

So this is probably specific to the "don't wrap fat arrow in braces if it's a one-line expression" rule.