Skip to content

Type canonicalization not consistently preserved / reset with ddc hot restart #37259

@jonahwilliams

Description

@jonahwilliams

Note: reproduction of this issue requires a checkout of flutter/flutter#34252 and dart-lang/webdev#440

Dart VM version: 2.3.3-dev.0.0.flutter-3166bbf24b (Tue Jun 11 16:24:18 2019 +0200) on "macos_x64"

Compiling the flutter gallery via the dev compiler/kernel initially succeeds. Applying a hot restart fails in different ways, depending on which library changed.

Case 1: Trigger Hot restart without changing anything

The hot reload fails due to a type error after re-invoking main:

The following assertion was thrown building IconTheme(IconThemeData#4acba(color:
dart_sdk.js:19255 Color(0xff007aff))):
dart_sdk.js:19255 Expected a value of type '(AnimationStatus) => void', but got one of type '(AnimationStatus) => void'

This corresponds to https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/animation/listener_helpers.dart#L170

Case 2: Change something upstream of listener_helpers.dart, like animation.dart.

The hot reload fails due to a slightly different type error

Uncaught (in promise) Error: Expected a value of type '(RawKeyEvent) => void', but got one of type '(RawKeyEvent) => void'

This corresponds to raw_keyboard.dart https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/raw_keyboard.dart#L477

Case 3: Change something in foundation.dart

Mostly success!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.customer-flutterweb-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions