Skip to content

Dart2JS dump info duplicates code related to method alias installation #49348

Open
@Markzipan

Description

@Markzipan

Snippet:

//@dart = 2.9

import 'package:expect/expect.dart';

class Super<T> {
  void method(T t) {}
}

class Mixin {
  void method(int t) {}
}

class Clazz = Super<int> with Mixin;

class Subclass extends Clazz {
  void test() {
	super.method(0);
  }
}

main() {
  Super<Object> s = new Subclass()..test();
  Expect.throws(() => s.method(''));
}

Generates function/mix.dart::Mixin.method and function/mix.dart::Clazz.method, both of which have an 81-byte code size overhead:
"code": "method$1(t) {\n }\nvar _ = A.Mixin.prototype;\n\n_.super$Mixin$method = _.method$1;\n",

However, that code snippet only occurs once. I suspect we're overcounting these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-infoweb-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions