Commit Graph

1 Commits

Author SHA1 Message Date
Harry Terkelsen df4bd6c398 Don't check for cycles in constructors in const evaluation
You can use the same constructor multiple times in a single constant
evaluation. For example:

    class A {
      final List<A> deps;
      const A({this.deps: const []});
    }

    const a = const A();
    const b = const A(deps: const [a]);

    main() { print(b); }

The program above will evaluate the 'A' constructor multiple times
when compiling the constant for 'b', but that's okay, as long as
we don't examine the same field (or local) multiple times.

Change-Id: Icda198ccb47ea91a046134f55deba9041fcf1f4a
Reviewed-on: https://dart-review.googlesource.com/15989
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-24 16:31:08 +00:00