Skip to content

new_with_abstract_class error message is confusing in Dart 2 #38695

Closed
@jamesderlin

Description

@jamesderlin

Running dartanalyzer on the following code:

abstract class Foo {}

final f = Foo();

generates:

error • Abstract classes can't be created with a 'new' expression at foo.dart:3:11 • new_with_abstract_class
1 error found.

This is a bit confusing since I didn't use new. It would be better if that were removed from the error message.

(I'm using Dart 2.5.1 on Linux x64.)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions