-
Notifications
You must be signed in to change notification settings - Fork 35
Default arguments #21
Comments
In second example did you mean optional return. In that case following is more declarative since we need either void or a type. getContext():void|type |
Sure, in Typescript uses type|void or type|null but since TurboScript is a superset of TypeScript we can have a convenient alternative. I think declaration of optional returning type better in Swift-like manner: this representation is more compact. Another variant: getContext()?: RenderContext Which more compatible form with argument optionals |
However according to this: microsoft/TypeScript#7426 |
getContext()?: RenderContext If above signature means getContext(): RenderContext {
return null;
} above code is valid. Also optional return is not possible since at compile time there must be only one type. Multiple return types must be handled with |
We need to implement default arguments. |
Ok, I got it. So I rename topic just for default arguments |
Is this needed for v1, i'd vote for v2? |
Let's move it to V2 since it's not blocking basic functionality
…On Wed 12. Apr 2017 at 4:21 PM, Wink Saville ***@***.***> wrote:
Is this needed for v1, i'd vote for v2?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMGZuRTFsWCh0VBw46teltZH9A_a4N-ks5rvN3ggaJpZM4Mpmhx>
.
|
andclass Renderer {
getContext(): RenderContext? {
...
}
}
The text was updated successfully, but these errors were encountered: