Skip to content

Infer the type of x in val f: (Int => Int) | Unit = x => x + 1 #11694

Closed
@smarter

Description

@smarter

Or more generally, try harder to infer function literal parameter types from expected type which are unions. The | Unit usecases matters particularly for scala.js where it's not uncommon for a parameter type to be written that way (because Unit corresponds to undefined in scala.js) but I assume that the explicit nulls language feature could run into the same sort of issues.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions