Skip to content

effective dart: advice on unnamed vs. constructor tear-off new constructors? #3525

@pq

Description

@pq

What information is missing?

With constructor tear-offs, there is a "new" way to define the unnamed constructor for a class.

class A {
  A.new();
}

Do we want to discourage people from using this syntax and prefer the less magic, more familiar (and equivalent):

class A {
  A();
}

?

How would you like us to fix this problem?

It'd be great if there were an effective dart ruling either way.

/cc @munificent @srawlins

Metadata

Metadata

Assignees

Labels

a.effective-dartRelates to the best practices explained in Effective Dartco.requestCommunity ask for documentatione0-minutesCan complete in < 60 minutes of normal, not dedicated, worke1-hoursCan complete in < 8 hours of normal, not dedicated, workp3-lowValid but not urgent concern. Resolve when possible. Encourage upvote to surface.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions