Skip to content

Feature request: infer class from type annotation in new expression. #74

@DartBot

Description

@DartBot

This issue was originally filed by michaels...@gmail.com


What steps will reproduce the problem?

class Point {
  Point(num this.x, num this.y);
  num x, y;
}

main() {
  Point p = new(3, 5);
  print(p.x + ', ' + p.y);
}

What is the expected output? What do you see instead?

In the line:

   Point p = new(3, 5);

The above should be interpreted as short-hand for:

   Point p = new Point(3, 5);

What version of the product are you using? On what operating system?

   Using try-dart-lang:
   http://try-dart-lang.appspot.com/s/3i8X

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-not-plannedClosed as we don't intend to take action on the reported issuetype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions