anchor.diff:  ''');
     }
   }
  +
  +@reflectiveTest
  +class UnnecessaryCastTestWithNullSafety extends UnnecessaryCastTest
  +    with WithNullSafetyMixin {}
  
positive.code: ''');
    }
  
    test_function() async {
      await assertNoErrorsInCode(r'''
  void f() {
    Function(Null) a = (String x) {};
    (a as Function(int))(3);
  }
  ''');
    }
  
    test_function2() async {
      await assertNoErrorsInCode(r'''
  class A {}
  
  class B<T extends A> {
    void foo() {
      T Function(T) f;
      f as A Function(A);
    }
  }
  ''');
    }
  
negative.code: import 'package:analyzer/src/error/codes.dart';
  import 'package:test_reflective_loader/test_reflective_loader.dart';
  
  import '../dart/constant/potentially_constant_test.dart';
  import '../dart/resolution/driver_resolution.dart';
  
  main() {
    defineReflectiveSuite(() {
      defineReflectiveTests(UnnecessaryCastTest);
      defineReflectiveTests(UnnecessaryCastTestWithNullSafety);
    });
  }
  
  