Skip to content

wrong type infer in 3.6.0-dev.20190725 #32572

@bluelovers

Description

@bluelovers

TypeScript Version: 3.4.0-dev.201xxxxx

Search Terms:

Code

this code work at 3.5.2 and 3.6.0-dev.20190704

but fail at 3.6.0-dev.20190725

import Bluebird = require('bluebird');

let a: string[] = [];

Bluebird.resolve(a as string[])
	.mapSeries(async function (vvvv)
	{
		console.log(vvvv.toUpperCase())

		return vvvv;
	})
;

Bluebird.resolve(a as string[])
	.mapSeries(function (vvvv)
	{
		console.log(vvvv.toUpperCase())

		return vvvv;
	})
;

Bluebird.resolve(a as string[])
	.mapSeries((vvvv) =>
	{
		console.log(vvvv.toUpperCase())

		return vvvv;
	})
;

Expected behavior:

no error and infer to string

Actual behavior:

vvvv infer to unknown

image

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions