Skip to content

wrong type infer in 3.6.0-dev.20190725 #32572

Closed
@bluelovers

Description

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions