dart-sdk/tests/language/nonfunction_type_aliases/generic_usage_function_error_test.dart
Lasse R.H. Nielsen cc736dfb65 [flip-modifiers]: Reapply "Enforce current library restrictions."
This reapplies commit 0c05e33836
and reverts the revert 029e0cec71.

Tested: Added few new tests, updated existing. Mainly regression testing.
CoreLibraryReviewExempt: Reviewed in original CL.
Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-03 09:37:38 +00:00

71 lines
1.5 KiB
Dart

// Copyright (c) 2019, 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.
import 'dart:async';
// Introduce an aliased type.
typedef T<X> = Function;
// Use the aliased type.
abstract class C {
final T<Null> v7;
C() : v7 = T();
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
class D1<X> extends T<X> {}
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
abstract class D2 extends C with T<int> {}
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
abstract class D3<X, Y> implements T<T> {}
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
abstract class D4 = C with T<void>;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
X foo<X>(X x) => x;
main() {
var v9 = <Set<T<T>>, Set<T<T>>>{{}: {}};
v9[{}] = {T<T>()};
// ^
// [analyzer] unspecified
// [cfe] unspecified
T<Null>();
//^
// [analyzer] unspecified
// [cfe] unspecified
T<Null>.named();
//^
// [analyzer] unspecified
// [cfe] unspecified
T<Object> v12 = foo<T<bool>>(T<bool>());
// ^
// [analyzer] unspecified
// [cfe] unspecified
T<List<List<List<List>>>>.staticMethod<T<int>>();
// ^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}