anchor.diff:    const B.named4();
   }
   ''');
  -    addNamedSource("/a.dart", r'''
  -class A {
  -  const A();
  -  const A.named();
  -}
  -''');
  -    addNamedSource("/b.dart", r'''
  +  }
  +
  +  test_optionalNew_rewrite_instantiatesToBounds() async {
  +    newFile("/test/lib/a.dart", content: r'''
  +class Unbounded<T> {
  +  const Unbounded();
  +  const Unbounded.named();
  +}
  +class Bounded<T extends String> {
  +  const Bounded();
  +  const Bounded.named();
  +}
  +''');
  +    newFile("/test/lib/b.dart", content: r'''
   import 'a.dart';
   import 'a.dart' as p;
   
  -const _a1 = A();
  -const _a2 = A.named();
  -const _a3 = p.A();
  -const _a4 = p.A.named();
  +const unbounded1 = Unbounded();
  +const unbounded2 = Unbounded.named();
  +const unbounded3 = p.Unbounded();
  +const unbounded4 = p.Unbounded.named();
  +const bounded1 = Bounded();
  +const bounded2 = Bounded.named();
  +const bounded3 = p.Bounded();
  +const bounded4 = p.Bounded.named();
   
   class B {
  -  const B.named1({this.a: _a1}) : assert(a != null);
  -  const B.named2({this.a: _a2}) : assert(a != null);
  -  const B.named3({this.a: _a3}) : assert(a != null);
  -  const B.named4({this.a: _a4}) : assert(a != null);
  -
  -  final A a;
  -}
  -''');
  -    await computeAnalysisResult(source);
  -    assertNoErrors(source);
  -    verify([source]);
  -  }
  -
  -  test_optionalNew_rewrite_instantiatesToBounds() async {
  -    resetWith(options: new AnalysisOptionsImpl());
  -    Source source = addSource(r'''
  +  const B.named1({this.unbounded: unbounded1}) : bounded = null;
  +  const B.named2({this.unbounded: unbounded2}) : bounded = null;
  +  const B.named3({this.unbounded: unbounded3}) : bounded = null;
  +  const B.named4({this.unbounded: unbounded4}) : bounded = null;
  +  const B.named5({this.bounded: bounded1}) : unbounded = null;
  +  const B.named6({this.bounded: bounded2}) : unbounded = null;
  +  const B.named7({this.bounded: bounded3}) : unbounded = null;
  +  const B.named8({this.bounded: bounded4}) : unbounded = null;
  +
  +  final Unbounded unbounded;
  +  final Bounded bounded;
  +}
  +''');
  +    await assertNoErrorsInCode(r'''
   import 'b.dart';
   
   @B.named1()
  
positive.code:   }
  }
  ''');
      await computeAnalysisResult(source);
      assertNoErrors(source);
      verify([source]);
    }
  
    test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
      Source source = addSource(r'''
  typedef Foo<S> = S Function<T>(T x);
  int foo<T>(T x) => 3;
  Foo bar() => foo;
  
negative.code: }
  main() {
    B.a.x = 0;
  }
  ''');
    }
  
    test_assignmentToFinals_importWithPrefix() async {
      newFile("/test/lib/lib1.dart", content: r'''
  library lib1;
  bool x = false;''');
      await assertNoErrorsInCode(r'''
  library lib;
  import 'lib1.dart' as foo;
  main() {
    foo.x = true;
  }
  ''');
    }
  
    test_async_dynamic_with_return() async {
      await assertNoErrorsInCode('''
  dynamic f() async {
    return;
  }
  ''');
    }
  
    test_async_dynamic_with_return_value() async {
      await assertNoErrorsInCode('''
  dynamic f() async {
    return 5;
  }
  ''');
    }
  
    test_async_dynamic_without_return() async {
      await assertNoErrorsInCode('''
  dynamic f() async {}
  ''');
    }
  
    test_async_expression_function_type() async {
      await assertNoErrorsInCode('''
  import 'dart:async';
  typedef Future<int> F(int i);
  main() {
    F f = (int i) async => i;
  }
  ''');
    }
  
    test_async_flattened() async {
      await assertNoErrorsInCode('''
  import 'dart:async';
  typedef Future<int> CreatesFutureInt();
  main() {
  