Skip to content

Restart with duplicate class name causes flutter run to hang #19571

@HansMuller

Description

@HansMuller

If the following app is run with one Foo class definition and then "hot restarted" after a second Foo definition is added, flutter run hangs.

class Foo { }
class Foo { }
void main() { print(new Foo()); }
Performing hot restart...                                        
compiler message: lib/main.dart:61:7: Error: Duplicated definition of 'Foo'.
compiler message: class Foo { }
compiler message:       ^
compiler message: lib/main.dart:60:11: Error: Duplicated name: Foo
compiler message: class Foo { }
compiler message:           ^
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(151)] Could not prepare to run the isolate.
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(116)] Engine not prepare and launch isolate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions