FirebaseExtended / bolt

Bolt Compiler (Firebase Security and Modeling)
Apache License 2.0
896 stars 108 forks source link

Add optional/nullable type syntax #225

Open reesjones opened 6 years ago

reesjones commented 6 years ago

It'd be nice to have syntactic sugar for optional/nullable types:

type Foo {
  bar: String | Null, // Replace this...
  baz: ?String, // with this!
}

Similar to flow or Swift or Kotlin optionals.

rockwotj commented 6 years ago

This is similar to typescript, and we could make it String? but what do you do if you have String | Numer?.