Skip to content

Unexpected change in analysis results when removing extends Object #45959

Closed
@bwilkerson

Description

@bwilkerson

Given a file a.dart containing

class A {
  void _foo() {}
}

class B {
  void _foo() {}
}

and another file containing

import 'a.dart';

class C extends Object with A, B {}

the analyzer produces the following expected diagnostic

error: The private name '_foo', defined by 'B', conflicts with the same name defined by 'A'. (private_collision_in_mixin_application)

But if the extends clause is removed:

import 'a.dart';

class C extends Object with A, B {}

then the diagnostic is not reported.

Is this a bug in the analyzer, or is this expected behavior?

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondart-model-analyzer-specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions