google / google/closure-compiler

Type of Promise<T> is not validated

Open
#2,402 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Given [this sample code](https://closure-compiler-debugger.appspot.com/#input0%3D%252F**%250A%2520*%2520%2540return%2520%257B!Promise%253Cboolean%253E%257D%250A%2520*%252F%250Afunction%2520a()%2520%257B%250A%2520%2520return%2520Promise.resolve().then(()%2520%253D%253E%2520'42')%253B%250A%257D%250A%250A%252F**%250A%2520*%2520%2540return%2520%257B!Promise%253Cboolean%253E%257D%250A%2520*%252F%250Afunction%2520b()%2520%257B%250A%2520%2520return%2520Promise.resolve().then(()%2520%253D%253E%2520Promise.resolve('42'))%253B%250A%257D%250A%250A%252F**%250A%2520*%2520%2540return%2520%257B!Promise%253Cboolean%253E%257D%250A%2520*%252F%250Afunction%2520c()%2520%257B%250A%2520%2520return%2520Promise.resolve('42')%253B%250A%257D%250A%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26MISSING_PROPERTIES%3D1%26TRANSPILE%3D1%26CHECK_TYPES%3D1%26CHECK_TYPES_NEW_INFERENCE%3D1%26CLOSURE_PASS%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1), all functions should show an error, but with NTI, none of them do, and with OTI, only one of them do.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.