Skip to content

Can't call conditional expression #255

Closed
@andy-hanson

Description

@andy-hanson
function f(x: i32): i32 { return x; }
function g(x: i32): i32 { return x + 2; }
export function test(b: boolean): i32 {
  return (b ? f : g)(1);
}

Currently fails with:

ERROR TS1005: ')' expected.

   return (b ? f : g)(1);
             ~

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions