Skip to content

Numeric widening and weak conformance #2451

Closed
@felixmulder

Description

@felixmulder

Currently we're doing what scalac is doing WRT to this issue. Example:

List(1, 2.3) // res: List[Double]

from a user standpoint, this should in a stricter language have been inferred as List[Int | Double]. In scalac they have a flag for this Ywarn-numeric-widen. Which is not yet implemented in Dotty.

If we choose not to make inference for this type of construct stricter, then we should definitely implement the Ywarn-numeric-widen-flag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions