// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // @dart = 2.7 /*class: A:implicit=[A]*/ abstract class A {} class B implements A {} /*spec.class: C:deps=[lookup],explicit=[C*,Map*],implicit=[C],needsArgs*/ /*prod.class: C:deps=[lookup],explicit=[C*],needsArgs*/ class C {} final Map map = {}; void setup() { map['x'] = new C(); } /*member: lookup:direct,explicit=[C*],needsArgs*/ C lookup(String key) { final value = map[key]; if (value != null && value is C) { return value; } throw 'Invalid C value for $key: ${value}'; } void lookupA() { lookup('x'); } main() { setup(); lookupA(); }