I don't understand why I need to declare the type-here, but it resolves the issue. Looks like a bug in tsc. Fixes #5784