- Notifications
You must be signed in to change notification settings - Fork 13.2k
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Description
TypeScript 3.7.2
Playground link
Compiler Options:
{"compilerOptions":{"noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "strictBindCallApply": true, "noImplicitThis": true, "noImplicitReturns": true, "useDefineForClassFields": false, "alwaysStrict": true, "allowUnreachableCode": false, "allowUnusedLabels": false, "downlevelIteration": false, "noEmitHelpers": false, "noLib": false, "noStrictGenericChecks": false, "noUnusedLocals": false, "noUnusedParameters": false, "esModuleInterop": true, "preserveConstEnums": false, "removeComments": false, "skipLibCheck": false, "checkJs": false, "allowJs": false, "experimentalDecorators": false, "emitDecoratorMetadata": false, "target": "ES2017", "module": "ESNext" } }Input:
interfaceQuoteFilter{_id: string;}interfaceQuoteFilterAdvancedextendsQuoteFilter{name: string;}functiongetQuoteFilters(): Promise<QuoteFilter[]>{returnnewPromise<QuoteFilter[]>((resolve,reject)=>{resolve([{_id: 'Test'}]);});}functiongetQuoteFiltersAdvanced(): Promise<QuoteFilterAdvanced[]>{returnnewPromise<QuoteFilterAdvanced[]>((resolve,reject)=>{resolve([{_id: 'Test',name: 'Test'}]);});}async()=>{const[filters,advanced]=awaitPromise.all([getQuoteFilters(),getQuoteFiltersAdvanced()]);}Output:
"use strict";functiongetQuoteFilters(){returnnewPromise((resolve,reject)=>{resolve([{_id: 'Test'}]);});}functiongetQuoteFiltersAdvanced(){returnnewPromise((resolve,reject)=>{resolve([{_id: 'Test',name: 'Test'}]);});}async()=>{const[filters,advanced]=awaitPromise.all([getQuoteFilters(),getQuoteFiltersAdvanced()]);};Expected behavior:
I am expecting the advanced variable to be an array of QuoteFilterAdvanced rather than QuoteFilter.
This was correctly inferred in Typescript 3.6.3
felixmosh, axross, bobdercole, IllusionMH, Bene-Graham and 23 moretholv7990, anton-bot and XGHeavenDamonOehlman, vultix and bcjohnblue
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue