Skip to content

Incremental compiler produces mixins with empty bodies #32368

@aam

Description

@aam

As discovered on flutter/flutter#14931, incremental compiler produces incorrect kernel file. In particular, for sample program t.dart

import 'package:collection/collection.dart';

main() {
  var a = new QueueList<int>();
  print(a.isEmpty);
}

_Object&ListMixin^^#T0 has no method bodies:

  abstract class _Object&ListMixin^^#T0<#T0 extends core::Object> extends core::Object implements col::ListMixin<que::_Object&ListMixin^^#T0::#T0> {
    synthetic constructor •() → void
      : super core::Object::•()
      ;
    method /* from  */ setRange(core::int start, core::int end, generic-covariant-impl generic-covariant-interface core::Iterable<que::_Object&ListMixin^^#T0::#T0> iterable, [core::int skipCount]) → void
      ;
    method /* from  */ addAll(generic-covariant-impl generic-covariant-interface core::Iterable<que::_Object&ListMixin^^#T0::#T0> iterable) → void
      ;
    method /* from  */ insert(core::int index, generic-covariant-impl generic-covariant-interface que::_Object&ListMixin^^#T0::#T0 element) → void
      ;
    operator /* from  */ +(generic-covariant-impl generic-covariant-interface core::List<que::_Object&ListMixin^^#T0::#T0> other) → core::List<que::_Object&ListMixin^^#T0::#T0>
      ;
    method /* from  */ insertAll(core::int index, generic-covariant-impl generic-covariant-interface core::Iterable<que::_Object&ListMixin^^#T0::#T0> iterable) → void
      ;
    method /* from  */ firstWhere((que::_Object&ListMixin^^#T0::#T0) → core::bool test, {generic-covariant-impl generic-covariant-interface () → que::_Object&ListMixin^^#T0::#T0 orElse}) → que::_Object&ListMixin^^#T0::#T0
      ;
    method /* from  */ setAll(core::int index, generic-covariant-impl generic-covariant-interface core::Iterable<que::_Object&ListMixin^^#T0::#T0> iterable) → void
      ;
    method /* from  */ fillRange(core::int start, core::int end, [generic-covariant-impl generic-covariant-interface que::_Object&ListMixin^^#T0::#T0 fill]) → void
      ;
    method /* from  */ add(generic-covariant-impl generic-covariant-interface que::_Object&ListMixin^^#T0::#T0 element) → void
      ;
    method /* from  */ reduce(generic-covariant-impl generic-covariant-interface (que::_Object&ListMixin^^#T0::#T0, que::_Object&ListMixin^^#T0::#T0) → que::_Object&ListMixin^^#T0::#T0 combine) → que::_Object&ListMixin^^#T0::#T0
      ;
    method /* from  */ lastWhere((que::_Object&ListMixin^^#T0::#T0) → core::bool test, {generic-covariant-impl generic-covariant-interface () → que::_Object&ListMixin^^#T0::#T0 orElse}) → que::_Object&ListMixin^^#T0::#T0
      ;
    method /* from  */ followedBy(generic-covariant-impl generic-covariant-interface core::Iterable<que::_Object&ListMixin^^#T0::#T0> other) → core::Iterable<que::_Object&ListMixin^^#T0::#T0>
      ;

To reproduce,

  • patch https://dart-review.googlesource.com/c/sdk/+/43888 in(it contains frontend_server extracted from flutter engine)
  • build all and utils/kernel-service:frontend_server_starter targets
  • copy <build_output>/vm_platform_strong.dill to <build_output>/platform_strong.dill. (cp xcodebuild/ReleaseX64/vm_platform_strong.dill xcodebuild/ReleaseX64/platform_strong.dill).
  • given t.dart from above run it through incremental compiler: xcodebuild/ReleaseX64/dart-sdk/bin/dart xcodebuild/ReleaseX64/gen/frontend_server_starter.dart.snapshot --sdk-root xcodebuild/ReleaseX64/ --strong --incremental t.dart.
  • dump contents of t.dart.dill xcodebuild/ReleaseX64/dart-sdk/bin/dart pkg/kernel/bin/dump.dart t.dart.dill > t.dart.dill.dumpir and look for class _Object&ListMixin in t.dart.dill.dumpir

Metadata

Metadata

Assignees

Labels

P0A serious issue requiring immediate resolutioncustomer-flutterlegacy-area-front-endLegacy: Use area-dart-model instead.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions