Skip to content

need super-mixins flag in Fasta to alter warnings/errors around super calls #31994

Closed
@mraleph

Description

@mraleph

When compiling Flutter we get a slew of errors like this:

compiler message: file:///usr/local/google/home/vegorov/src/flutter-clean/flutter/packages/flutter/lib/src/rendering/binding.dart:295:11: Error: Superclass has no method named 'hitTest'.
compiler message:     super.hitTest(result, position); // ignore: abstract_super_member_reference
compiler message:  

The error comes from this code:

/// An object that can hit-test pointers.
abstract class HitTestable { // ignore: one_member_abstracts
  // This class is intended to be used as an interface with the implements
  // keyword, and should not be extended directly.
  factory HitTestable._() => null;

  /// Check whether the given position hits this object.
  ///
  /// If this given position hits this object, consider adding a [HitTestEntry]
  /// to the given hit test result.
  void hitTest(HitTestResult result, Offset position);
}

/// The glue between the render tree and the Flutter engine.
abstract class RendererBinding extends BindingBase with ServicesBinding, SchedulerBinding, HitTestable {
  // This class is intended to be used as a mixin, and should not be
  // extended directly.
  factory RendererBinding._() => null;

  @override
  void hitTest(HitTestResult result, Offset position) {
    // ...
    // This super call is safe since it will be bound to a mixed-in declaration.
    super.hitTest(result, position); // ignore: abstract_super_member_reference
  }

}

as you can see the error is valid because Dart language conflates the notion of a class and a mixin together. You can also see that the error is suppressed in the analyzer.

To make Flutter builds error free we need a way to perform a similar suppression in CFE, while retaining correctness.

/cc @kmillikin @peter-ahe-google @leafpetersen @lrhn

Metadata

Metadata

Assignees

Labels

P0A serious issue requiring immediate resolutionarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions