[cfe] Make DartTypeVisitor(1) a pure interface

This splits DartTypeVisitor(1) into a pure interface and a
DartTypeVisitor(1)DefaultMixin with the base implementation. This is
a step towards avoid having an accidental default implementation where
a static error would have been preferable.

TEST=existing

Change-Id: Ieea9a773a9b70897a2db10cff8d721831a702a8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther
2023-09-08 11:59:41 +00:00
committed by Commit Queue
parent e401b6f18a
commit fefa87d1e6
28 changed files with 1029 additions and 496 deletions
+5
View File
@@ -218,6 +218,11 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
DartType defaultDartType(ir.DartType node) {
throw UnsupportedError('Unsupported type $node (${node.runtimeType})');
}
@override
DartType visitTypedefType(ir.TypedefType node) {
throw UnsupportedError('Unsupported type $node (${node.runtimeType})');
}
}
class ConstantValuefier extends ir.ComputeOnceConstantVisitor<ConstantValue> {
@@ -255,6 +255,10 @@ class _TypeRecipeVisitor extends DartTypeVisitor<String> {
String defaultDartType(DartType node) =>
throw UnimplementedError('Unknown DartType: $node');
@override
String visitInvalidType(DartType node) =>
throw UnimplementedError('Unknown DartType: $node');
@override
String visitDynamicType(DynamicType node) => Recipe.pushDynamicString;
@@ -24,6 +24,7 @@ import 'package:kernel/ast.dart';
import 'package:kernel/class_hierarchy.dart';
import 'package:kernel/core_types.dart';
import 'package:kernel/src/const_canonical_type.dart';
import 'package:kernel/src/find_type_visitor.dart';
import 'package:kernel/src/legacy_erasure.dart';
import 'package:kernel/src/norm.dart';
import 'package:kernel/src/printer.dart'
@@ -6215,88 +6216,25 @@ class SimpleErrorReporter implements ErrorReporter {
}
bool isInstantiated(DartType type) {
return type.accept(new IsInstantiatedVisitor());
return !type.accept(new HasUninstantiatedVisitor());
}
class IsInstantiatedVisitor implements DartTypeVisitor<bool> {
class HasUninstantiatedVisitor extends FindTypeVisitor {
final _availableVariables = new Set<TypeParameter>();
bool isInstantiated(DartType type) {
return type.accept(this);
}
@override
bool defaultDartType(DartType node) {
// Probably unreachable.
throw 'A visitor method seems to be unimplemented!';
}
@override
bool visitInvalidType(InvalidType node) => true;
@override
bool visitDynamicType(DynamicType node) => true;
@override
bool visitVoidType(VoidType node) => true;
@override
bool visitNullType(NullType node) => true;
@override
bool visitTypeParameterType(TypeParameterType node) {
return _availableVariables.contains(node.parameter);
}
@override
bool visitInterfaceType(InterfaceType node) {
return node.typeArguments
.every((DartType typeArgument) => typeArgument.accept(this));
}
@override
bool visitFutureOrType(FutureOrType node) {
return node.typeArgument.accept(this);
return !_availableVariables.contains(node.parameter);
}
@override
bool visitFunctionType(FunctionType node) {
final List<TypeParameter> parameters = node.typeParameters;
_availableVariables.addAll(parameters);
final bool result = node.typeParameters
.every((p) => p.bound.accept(this) && p.defaultType.accept(this)) &&
node.returnType.accept(this) &&
node.positionalParameters.every((p) => p.accept(this)) &&
node.namedParameters.every((p) => p.type.accept(this));
bool result = super.visitFunctionType(node);
_availableVariables.removeAll(parameters);
return result;
}
@override
bool visitTypedefType(TypedefType node) {
// Probably unreachable.
return node.unalias.accept(this);
}
@override
bool visitNeverType(NeverType node) => true;
@override
bool visitRecordType(RecordType node) {
return node.positional.every((p) => p.accept(this)) &&
node.named.every((p) => p.type.accept(this));
}
@override
bool visitExtensionType(ExtensionType node) {
return node.typeArguments
.every((DartType typeArgument) => typeArgument.accept(this));
}
@override
bool visitIntersectionType(IntersectionType node) {
return node.left.accept(this) && node.right.accept(this);
}
}
bool _isFormalParameter(VariableDeclaration variable) {
@@ -4,6 +4,8 @@
import 'package:kernel/ast.dart';
import 'package:kernel/src/find_type_visitor.dart';
import 'package:kernel/type_algebra.dart' show containsTypeVariable;
import 'package:kernel/util/graph.dart' show Graph, computeStrongComponents;
@@ -1334,86 +1336,11 @@ bool hasAnyTypeVariables(DartType type) {
/// Don't use this directly, use [hasAnyTypeVariables] instead. But don't use
/// that either.
// TODO(ahe): Remove this class.
class TypeVariableSearch implements DartTypeVisitor<bool> {
class TypeVariableSearch extends FindTypeVisitor {
const TypeVariableSearch();
@override
bool defaultDartType(DartType node) => throw "unsupported";
bool anyTypeVariables(List<DartType> types) {
for (DartType type in types) {
if (type.accept(this)) return true;
}
return false;
}
@override
bool visitInvalidType(InvalidType node) => false;
@override
bool visitDynamicType(DynamicType node) => false;
@override
bool visitVoidType(VoidType node) => false;
@override
bool visitNeverType(NeverType node) => false;
@override
bool visitNullType(NullType node) => false;
@override
bool visitInterfaceType(InterfaceType node) {
return anyTypeVariables(node.typeArguments);
}
@override
bool visitExtensionType(ExtensionType node) {
return anyTypeVariables(node.typeArguments);
}
@override
bool visitFutureOrType(FutureOrType node) {
return node.typeArgument.accept(this);
}
@override
bool visitFunctionType(FunctionType node) {
if (anyTypeVariables(node.positionalParameters)) return true;
for (TypeParameter variable in node.typeParameters) {
if (variable.bound.accept(this)) return true;
}
for (NamedType type in node.namedParameters) {
if (type.type.accept(this)) return true;
}
return false;
}
@override
bool visitTypeParameterType(TypeParameterType node) => true;
@override
bool visitIntersectionType(IntersectionType node) {
// The left-hand side of an [IntersectionType] is always a
// [TypeParameterType].
// ignore: unnecessary_type_check
assert(node.left is TypeParameterType);
return true;
}
@override
bool visitTypedefType(TypedefType node) {
return anyTypeVariables(node.typeArguments);
}
@override
bool visitRecordType(RecordType node) {
if (anyTypeVariables(node.positional)) return true;
for (NamedType namedType in node.named) {
if (namedType.type.accept(this)) return true;
}
return false;
}
}
/// A representation of a found non-simplicity issue in bounds
@@ -343,7 +343,7 @@ class ExpressionInferenceResult {
ExpressionInferenceResult(this.inferredType, this.expression,
{this.postCoercionType = null})
: assert(isKnown(inferredType));
: assert(isKnown(inferredType), "$inferredType is not known.");
/// The guards used for null-aware access if the expression is part of a
/// null-shorting.
@@ -739,6 +739,7 @@ abstract class InferenceVisitorBase implements InferenceVisitor {
DartType contextType, Template<Message Function(String)> template) {
Expression errorNode = new AsExpression(
expression,
// TODO(johnniwinther): Fix this.
// TODO(ahe): The outline phase doesn't correctly remove invalid
// uses of type variables, for example, on static members. Once
// that has been fixed, we should always be able to use
@@ -763,6 +764,7 @@ abstract class InferenceVisitorBase implements InferenceVisitor {
{List<LocatedMessage>? context}) {
Expression errorNode = new AsExpression(
expression,
// TODO(johnniwinther): Fix this.
// TODO(ahe): The outline phase doesn't correctly remove invalid
// uses of type variables, for example, on static members. Once
// that has been fixed, we should always be able to use
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE.md file.
import 'package:kernel/ast.dart';
import 'package:kernel/src/find_type_visitor.dart';
import 'package:kernel/src/replacement_visitor.dart';
/// Returns `true` if type contains a promoted type variable.
@@ -11,43 +12,9 @@ bool hasPromotedTypeVariable(DartType type) {
}
/// Visitor that returns `true` if a type contains a promoted type variable.
class _HasPromotedTypeVariableVisitor extends DartTypeVisitor<bool> {
class _HasPromotedTypeVariableVisitor extends FindTypeVisitor {
const _HasPromotedTypeVariableVisitor();
@override
bool defaultDartType(DartType node) => false;
@override
bool visitFunctionType(FunctionType node) {
if (node.returnType.accept(this)) return true;
for (DartType parameterType in node.positionalParameters) {
if (parameterType.accept(this)) return true;
}
for (NamedType namedParameterType in node.namedParameters) {
if (namedParameterType.type.accept(this)) return true;
}
return false;
}
@override
bool visitInterfaceType(InterfaceType node) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept(this)) return true;
}
return false;
}
@override
bool visitTypedefType(TypedefType node) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept(this)) return true;
}
return false;
}
@override
bool visitTypeParameterType(TypeParameterType node) => false;
@override
bool visitIntersectionType(IntersectionType node) => true;
}
@@ -4,6 +4,7 @@
import 'package:kernel/ast.dart';
import 'package:kernel/src/assumptions.dart';
import 'package:kernel/src/find_type_visitor.dart';
import 'package:kernel/src/printer.dart';
import 'package:kernel/import_table.dart' show ImportTable;
@@ -12,7 +13,7 @@ import 'package:kernel/text/ast_to_text.dart'
show Annotator, NameSystem, Printer, globalDebuggingNames;
/// Determines whether a type schema contains `?` somewhere inside it.
bool isKnown(DartType schema) => schema.accept(const _IsKnownVisitor());
bool isKnown(DartType schema) => !schema.accept(const _HasUnknownVisitor());
/// Converts a [DartType] to a string, representing the unknown type as `?`.
String typeSchemaToString(DartType schema) {
@@ -95,87 +96,10 @@ class UnknownType extends DartType {
}
}
/// Visitor that computes [isKnown].
class _IsKnownVisitor implements DartTypeVisitor<bool> {
const _IsKnownVisitor();
/// Visitor used to compute [isKnown].
class _HasUnknownVisitor extends FindTypeVisitor {
const _HasUnknownVisitor();
@override
bool defaultDartType(DartType node) => node is! UnknownType;
@override
bool visitDynamicType(DynamicType node) => true;
@override
bool visitInvalidType(InvalidType node) => true;
@override
bool visitNeverType(NeverType node) => true;
@override
bool visitIntersectionType(IntersectionType node) => true;
@override
bool visitNullType(NullType node) => true;
@override
bool visitTypeParameterType(TypeParameterType node) => true;
@override
bool visitVoidType(VoidType node) => true;
@override
bool visitFunctionType(FunctionType node) {
if (!node.returnType.accept(this)) return false;
for (DartType parameterType in node.positionalParameters) {
if (!parameterType.accept(this)) return false;
}
for (NamedType namedParameterType in node.namedParameters) {
if (!namedParameterType.type.accept(this)) return false;
}
for (TypeParameter typeParameter in node.typeParameters) {
if (!typeParameter.bound.accept(this)) return false;
if (!typeParameter.defaultType.accept(this)) return false;
}
return true;
}
@override
bool visitInterfaceType(InterfaceType node) {
for (DartType typeArgument in node.typeArguments) {
if (!typeArgument.accept(this)) return false;
}
return true;
}
@override
bool visitExtensionType(ExtensionType node) {
for (DartType typeArgument in node.typeArguments) {
if (!typeArgument.accept(this)) return false;
}
return true;
}
@override
bool visitRecordType(RecordType node) {
for (DartType positional in node.positional) {
if (!positional.accept(this)) return false;
}
for (NamedType named in node.named) {
if (!named.type.accept(this)) return false;
}
return true;
}
@override
bool visitFutureOrType(FutureOrType node) {
return node.typeArgument.accept(this);
}
@override
bool visitTypedefType(TypedefType node) {
for (DartType typeArgument in node.typeArguments) {
if (!typeArgument.accept(this)) return false;
}
return true;
}
bool defaultDartType(DartType node) => node is UnknownType;
}
@@ -100,7 +100,7 @@ B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in #C12 as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C12 as{TypeError} Never as{TypeError} Never;
static method test18() → () → self::B<core::num>
return #C9;
static method test19() → () → self::B<core::num>
@@ -118,7 +118,7 @@ B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in #C13 as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C13 as{TypeError} Never as{TypeError} Never;
static method test24() → () → self::B<core::String>
return #C14;
static method main() → dynamic {}
@@ -100,7 +100,7 @@ B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in #C12 as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C12 as{TypeError} Never;
static method test18() → () → self::B<core::num>
return #C9;
static method test19() → () → self::B<core::num>
@@ -118,7 +118,7 @@ B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in #C13 as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C13 as{TypeError} Never;
static method test24() → () → self::B<core::String>
return #C14;
static method main() → dynamic {}
@@ -100,7 +100,7 @@ B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in #C12 as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C12 as{TypeError} Never as{TypeError} Never;
static method test18() → () → self::B<core::num>
return #C9;
static method test19() → () → self::B<core::num>
@@ -118,7 +118,7 @@ B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in #C13 as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C13 as{TypeError} Never as{TypeError} Never;
static method test24() → () → self::B<core::String>
return #C14;
static method main() → dynamic {}
@@ -100,7 +100,7 @@ B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in #C12 as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C12 as{TypeError} Never as{TypeError} Never;
static method test18() → () → self::B<core::num>
return #C9;
static method test19() → () → self::B<core::num>
@@ -118,7 +118,7 @@ B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in #C13 as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%> as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C13 as{TypeError} Never as{TypeError} Never;
static method test24() → () → self::B<core::String>
return #C14;
static method main() → dynamic {}
@@ -100,7 +100,7 @@ B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in #C12 as{TypeError} <Y extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C12 as{TypeError} Never;
static method test18() → () → self::B<core::num>
return #C9;
static method test19() → () → self::B<core::num>
@@ -118,7 +118,7 @@ B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in #C13 as{TypeError} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
^" in #C13 as{TypeError} Never;
static method test24() → () → self::B<core::String>
return #C14;
static method main() → dynamic {}
@@ -23,14 +23,14 @@ test(
List<T4> t4b, // Error,
void Function(T4) t4c, // Error
void Function(List<T4>) t4d, // Error
T5 t5a, // Error,
List<T5> t5b, // Error,
void Function(T5) t5c, // Error
void Function(List<T5>) t5d, // Error
T6 t6a, // Error,
List<T6> t6b, // Error,
void Function(T6) t6c, // Error
void Function(List<T6>) t6d, // Error
T5 t5a, // Ok,
List<T5> t5b, // Ok,
void Function(T5) t5c, // Ok
void Function(List<T5>) t5d, // Ok
T6 t6a, // Ok,
List<T6> t6b, // Ok,
void Function(T6) t6c, // Ok
void Function(List<T6>) t6d, // Ok
T7 t7a, // Error,
List<T7> t7b, // Error,
void Function(T7) t7c, // Error
@@ -39,6 +39,22 @@ test(
List<T8> t8b, // Error,
void Function(T8) t8c, // Error
void Function(List<T8>) t8d, // Error
T9 t9a, // Error,
List<T9> t9b, // Error,
void Function(T9) t9c, // Error
void Function(List<T9>) t9d, // Error
T10 t10a, // Error,
List<T10> t10b, // Error,
void Function(T10) t10c, // Error
void Function(List<T10>) t10d, // Error
T11 t11a, // Ok,
List<T11> t11b, // Ok,
void Function(T11) t11c, // Ok
void Function(List<T11>) t11d, // Ok
T12 t12a, // Error,
List<T12> t12b, // Error,
void Function(T12) t12c, // Error
void Function(List<T12>) t12d, // Error
) {
new T4(); // Error
<T4>[]; // Error
@@ -66,43 +66,150 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// - 'List' is from 'dart:core'.
// new T7(0); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:59:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// new T4(); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:60:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <T4>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:61:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(T4)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:62:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(List<T4>)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:64:4: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <T7>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:65:18: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(T7)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:66:23: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(List<T7>)>[]; // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>[];
<(ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void>[];
<(core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void>[];
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
- 'List' is from 'dart:core'.
new T7(0); // Error
^" in 0 as{TypeError} core::List<dynamic>);
@@ -116,6 +223,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -124,6 +233,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
: super core::Object::•()
@@ -139,7 +252,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
}
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
ali::ExtensionType|<dynamic>(<dynamic>[]);
}
@@ -66,43 +66,150 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// - 'List' is from 'dart:core'.
// new T7(0); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:59:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// new T4(); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:60:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <T4>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:61:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(T4)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:62:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(List<T4>)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:64:4: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <T7>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:65:18: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(T7)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:66:23: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(List<T7>)>[]; // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
core::_GrowableList::•<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>(0);
core::_GrowableList::•<(ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void>(0);
core::_GrowableList::•<(core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void>(0);
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
- 'List' is from 'dart:core'.
new T7(0); // Error
^" in 0 as{TypeError} core::List<dynamic>);
@@ -116,6 +223,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -124,6 +233,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
: super core::Object::•()
@@ -139,7 +252,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
}
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
ali::ExtensionType|<dynamic>(core::_GrowableList::•<dynamic>(0));
}
@@ -34,5 +34,21 @@ test(
List<T8> t8b,
void Function(T8) t8c,
void Function(List<T8>) t8d,
T9 t9a,
List<T9> t9b,
void Function(T9) t9c,
void Function(List<T9>) t9d,
T10 t10a,
List<T10> t10b,
void Function(T10) t10c,
void Function(List<T10>) t10d,
T11 t11a,
List<T11> t11b,
void Function(T11) t11c,
void Function(List<T11>) t11d,
T12 t12a,
List<T12> t12b,
void Function(T12) t12c,
void Function(List<T12>) t12d,
) {}
main() {}
@@ -35,4 +35,20 @@ test(
List<T8> t8b,
void Function(T8) t8c,
void Function(List<T8>) t8d,
T9 t9a,
List<T9> t9b,
void Function(T9) t9c,
void Function(List<T9>) t9d,
T10 t10a,
List<T10> t10b,
void Function(T10) t10c,
void Function(List<T10>) t10d,
T11 t11a,
List<T11> t11b,
void Function(T11) t11c,
void Function(List<T11>) t11d,
T12 t12a,
List<T12> t12b,
void Function(T12) t12c,
void Function(List<T12>) t12d,
) {}
@@ -66,43 +66,150 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// - 'List' is from 'dart:core'.
// new T7(0); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:59:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// new T4(); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:60:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <T4>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:61:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(T4)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:62:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(List<T4>)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:64:4: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <T7>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:65:18: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(T7)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:66:23: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(List<T7>)>[]; // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>[];
<(ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void>[];
<(core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void>[];
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
- 'List' is from 'dart:core'.
new T7(0); // Error
^" in 0 as{TypeError} core::List<dynamic>);
@@ -116,6 +223,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -124,6 +233,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
: super core::Object::•()
@@ -139,7 +252,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
}
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
ali::ExtensionType|<dynamic>(<dynamic>[]);
}
@@ -66,43 +66,150 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// - 'List' is from 'dart:core'.
// new T7(0); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:59:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// new T4(); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:60:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <T4>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:61:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(T4)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:62:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(List<T4>)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:64:4: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <T7>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:65:18: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(T7)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:66:23: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(List<T7>)>[]; // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>[];
<(ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void>[];
<(core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void>[];
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
- 'List' is from 'dart:core'.
new T7(0); // Error
^" in 0 as{TypeError} core::List<dynamic>);
@@ -116,6 +223,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -124,6 +233,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
: super core::Object::•()
@@ -139,7 +252,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
}
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
ali::ExtensionType|<dynamic>(<dynamic>[]);
}
@@ -66,13 +66,105 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic
;
static method main() → dynamic
;
@@ -81,6 +173,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -89,6 +183,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
;
@@ -101,7 +199,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
;
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic
;
static method _#T4#new#tearOff<X extends <T extends core::Object? = dynamic>(T%) → void>() → ali::Class<ali::_#T4#new#tearOff::X>
return new ali::Class::•<ali::_#T4#new#tearOff::X>();
@@ -66,43 +66,150 @@ library;
// void Function(List<T3>) t3d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:34:3: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// T7 t7a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:35:8: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// List<T7> t7b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:36:17: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(T7) t7c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:37:22: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// void Function(List<T7>) t7d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:42:3: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T9 t9a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:8: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T9> t9b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:17: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T9) t9c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:22: Error: Generic function type '(List<void Function<T>(T)>, int)' used as a type argument through typedef 'T9'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T9>) t9d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:3: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T10 t10a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:8: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T10> t10b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:48:17: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T10) t10c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:49:22: Error: Generic function type '({List<void Function<T>(T)> a, int b})' used as a type argument through typedef 'T10'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T10>) t10d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:54:3: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// T12 t12a, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:55:8: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// List<T12> t12b, // Error,
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:56:17: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(T12) t12c, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:57:22: Error: Generic function type 'FutureOr<List<void Function<T>(T)>>' used as a type argument through typedef 'T12'.
// - 'List' is from 'dart:core'.
// Try providing a non-generic function type explicitly.
// void Function(List<T12>) t12d, // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
// - 'List' is from 'dart:core'.
// new T7(0); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:43:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:59:7: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// new T4(); // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:44:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:60:4: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <T4>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:45:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:61:18: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(T4)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:46:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:62:23: Error: Generic function type 'void Function<T>(T)' inferred as a type argument.
// Try providing a non-generic function type explicitly.
// <void Function(List<T4>)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:64:4: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <T7>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:65:18: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(T7)>[]; // Error
// ^
//
// pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:66:23: Error: Generic function type 'ExtensionType<void Function<T>(T)>' used as a type argument through typedef 'T7'.
// Try providing a non-generic function type explicitly.
// <void Function(List<T7>)>[]; // Error
// ^
//
import self as self;
import "dart:core" as core;
import "alias_from_opt_in_lib.dart" as ali;
import "org-dartlang-testcase:///alias_from_opt_in_lib.dart";
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1a, core::List<<T extends core::Object? = dynamic>(T%) → void> t1b, (<T extends core::Object? = dynamic>(T%) → void) → void t1c, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t1d, (<T extends core::Object? = dynamic>(T%) → void) → void t2a, core::List<(<T extends core::Object? = dynamic>(T%) → void) → void> t2b, ((<T extends core::Object? = dynamic>(T%) → void) → void) → void t2c, (core::List<(<T extends core::Object? = dynamic>(T%) → void) → void>) → void t2d, core::List<<T extends core::Object? = dynamic>(T%) → void> t3a, core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>> t3b, (core::List<<T extends core::Object? = dynamic>(T%) → void>) → void t3c, (core::List<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t3d, ali::Class<<T extends core::Object? = dynamic>(T%) → void> t4a, core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>> t4b, (ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void t4c, (core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void t4d, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5a, core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)> t5b, ((<T extends core::Object? = dynamic>(T%) → void, core::int)) → void t5c, (core::List<(<T extends core::Object? = dynamic>(T%) → void, core::int)>) → void t5d, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6a, core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})> t6b, (({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})) → void t6c, (core::List<({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int})>) → void t6d, ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */ t7a, core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */> t7b, (ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */) → void t7c, (core::List<ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */>) → void t7d, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8a, core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void> t8b, (<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void) → void t8c, (core::List<<S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void>) → void t8d, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9a, core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)> t9b, ((core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)) → void t9c, (core::List<(core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int)>) → void t9d, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10a, core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})> t10b, (({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})) → void t10c, (core::List<({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int})>) → void t10d, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11a, core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>> t11b, (FutureOr<<T extends core::Object? = dynamic>(T%) → void>) → void t11c, (core::List<FutureOr<<T extends core::Object? = dynamic>(T%) → void>>) → void t11d, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12a, core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>> t12b, (FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>) → void t12c, (core::List<FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>>) → void t12d) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
core::_GrowableList::•<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>(0);
core::_GrowableList::•<(ali::Class<<T extends core::Object? = dynamic>(T%) → void>) → void>(0);
core::_GrowableList::•<(core::List<ali::Class<<T extends core::Object? = dynamic>(T%) → void>>) → void>(0);
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:47:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
ali::ExtensionType|<dynamic>(invalid-expression "pkg/front_end/testcases/generic_metadata/alias_from_opt_in.dart:63:10: Error: The argument type 'int' can't be assigned to the parameter type 'List<dynamic>'.
- 'List' is from 'dart:core'.
new T7(0); // Error
^" in 0 as{TypeError} core::List<dynamic>);
@@ -116,6 +223,8 @@ library;
import self as ali;
import "dart:core" as core;
import "dart:async";
typedef T1 = <T extends core::Object? = dynamic>(T%) → void;
typedef T2 = (<T extends core::Object? = dynamic>(T%) → void) → void;
typedef T3 = core::List<<T extends core::Object? = dynamic>(T%) → void>;
@@ -124,6 +233,10 @@ typedef T5 = (<T extends core::Object? = dynamic>(T%) → void, core::int);
typedef T6 = ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int});
typedef T7 = ali::ExtensionType<<T extends core::Object? = dynamic>(T%) → void> /* = core::List<<T extends core::Object? = dynamic>(T%) → void> */;
typedef T8 = <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void;
typedef T9 = (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int);
typedef T10 = ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int});
typedef T11 = FutureOr<<T extends core::Object? = dynamic>(T%) → void>;
typedef T12 = FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>;
class Class<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() → ali::Class<ali::Class::T%>
: super core::Object::•()
@@ -139,7 +252,7 @@ static inline-class-member method ExtensionType|<T extends core::Object? = dynam
}
static inline-class-member method ExtensionType|_#new#tearOff<T extends core::Object? = dynamic>(core::List<ali::ExtensionType|_#new#tearOff::T%> it) → ali::ExtensionType<ali::ExtensionType|_#new#tearOff::T%> /* = core::List<ali::ExtensionType|_#new#tearOff::T%> */
return ali::ExtensionType|<ali::ExtensionType|_#new#tearOff::T%>(it);
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8) → dynamic {
static method test(<T extends core::Object? = dynamic>(T%) → void t1, <T extends core::Object? = dynamic>(T%) → void t2, core::List<<T extends core::Object? = dynamic>(T%) → void> t3, (<T extends core::Object? = dynamic>(T%) → void, core::int) t5, ({required a: <T extends core::Object? = dynamic>(T%) → void, required b: core::int}) t6, <S extends <T extends core::Object? = dynamic>(T%) → void = dynamic>(S) → void t8, (core::List<<T extends core::Object? = dynamic>(T%) → void>, core::int) t9, ({required a: core::List<<T extends core::Object? = dynamic>(T%) → void>, required b: core::int}) t10, FutureOr<<T extends core::Object? = dynamic>(T%) → void>t11, FutureOr<core::List<<T extends core::Object? = dynamic>(T%) → void>>t12) → dynamic {
new ali::Class::•<<T extends core::Object? = dynamic>(T%) → void>();
ali::ExtensionType|<dynamic>(core::_GrowableList::•<dynamic>(0));
}
@@ -2,6 +2,8 @@
// 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';
class Class<T> {}
typedef T1 = void Function<T>(T);
@@ -12,6 +14,10 @@ typedef T5 = (void Function<T>(T), int);
typedef T6 = ({void Function<T>(T) a, int b});
typedef T7 = ExtensionType<void Function<T>(T)>;
typedef T8 = void Function<S extends void Function<T>(T)>(S);
typedef T9 = (List<void Function<T>(T)>, int);
typedef T10 = ({List<void Function<T>(T)> a, int b});
typedef T11 = FutureOr<void Function<T>(T)>;
typedef T12 = FutureOr<List<void Function<T>(T)>>;
extension type ExtensionType<T>(List<T> it) {}
@@ -22,6 +28,10 @@ test(
T5 t5, // Ok
T6 t6, // Ok
T8 t8, // Ok
T9 t9, // Ok
T10 t10, // Ok
T11 t11, // Ok
T12 t12, // Ok
) {
new T4(); // Ok
new T7([]); // Ok
+54 -9
View File
@@ -2,17 +2,12 @@
// 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 'package:kernel/src/replacement_visitor.dart';
import '../ast.dart';
import '../type_algebra.dart' show Substitution, substitute;
import '../type_environment.dart' show SubtypeCheckMode, TypeEnvironment;
import '../util/graph.dart' show Graph, computeStrongComponents;
import 'legacy_erasure.dart';
import 'replacement_visitor.dart';
class TypeVariableGraph extends Graph<int> {
@override
@@ -927,7 +922,6 @@ bool hasGenericFunctionTypeAsTypeArgument(DartType type) {
const _HasGenericFunctionTypeAsTypeArgumentVisitor(), false);
}
// TODO(johnniwinther): Handle record type and extension type in this visitor.
class _HasGenericFunctionTypeAsTypeArgumentVisitor
extends DartTypeVisitor1<bool, bool> {
const _HasGenericFunctionTypeAsTypeArgumentVisitor();
@@ -940,8 +934,6 @@ class _HasGenericFunctionTypeAsTypeArgumentVisitor
if (isTypeArgument && node.typeParameters.isNotEmpty) {
return true;
}
// TODO(johnniwinther): Should deeply nested generic function types be
// disallowed?
if (node.returnType.accept1(this, false)) return true;
for (DartType parameterType in node.positionalParameters) {
if (parameterType.accept1(this, false)) return true;
@@ -949,6 +941,11 @@ class _HasGenericFunctionTypeAsTypeArgumentVisitor
for (NamedType namedParameterType in node.namedParameters) {
if (namedParameterType.type.accept1(this, false)) return true;
}
for (TypeParameter typeParameter in node.typeParameters) {
if (typeParameter.bound.accept1(this, false)) {
return true;
}
}
return false;
}
@@ -967,4 +964,52 @@ class _HasGenericFunctionTypeAsTypeArgumentVisitor
}
return false;
}
@override
bool visitExtensionType(ExtensionType node, bool isTypeArgument) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept1(this, true)) return true;
}
return false;
}
@override
bool visitDynamicType(DynamicType node, bool isTypeArgument) => false;
@override
bool visitFutureOrType(FutureOrType node, bool isTypeArgument) {
return node.typeArgument.accept1(this, false);
}
@override
bool visitIntersectionType(IntersectionType node, bool isTypeArgument) {
return node.left.accept1(this, false) || node.right.accept1(this, false);
}
@override
bool visitInvalidType(InvalidType node, bool isTypeArgument) => false;
@override
bool visitNeverType(NeverType node, bool isTypeArgument) => false;
@override
bool visitNullType(NullType node, bool isTypeArgument) => false;
@override
bool visitRecordType(RecordType node, bool isTypeArgument) {
for (DartType parameterType in node.positional) {
if (parameterType.accept1(this, false)) return true;
}
for (NamedType namedParameterType in node.named) {
if (namedParameterType.type.accept1(this, false)) return true;
}
return false;
}
@override
bool visitTypeParameterType(TypeParameterType node, bool isTypeArgument) =>
false;
@override
bool visitVoidType(VoidType node, bool isTypeArgument) => false;
}
+91
View File
@@ -0,0 +1,91 @@
// Copyright (c) 2023, 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.md file.
import '../ast.dart';
class FindTypeVisitor implements DartTypeVisitor<bool> {
const FindTypeVisitor();
@override
bool defaultDartType(DartType node) => false;
@override
bool visitFunctionType(FunctionType node) {
if (node.returnType.accept(this)) return true;
for (DartType parameterType in node.positionalParameters) {
if (parameterType.accept(this)) return true;
}
for (NamedType namedParameterType in node.namedParameters) {
if (namedParameterType.type.accept(this)) return true;
}
for (TypeParameter parameter in node.typeParameters) {
if (parameter.bound.accept(this)) return true;
if (parameter.defaultType.accept(this)) return true;
}
return false;
}
@override
bool visitInterfaceType(InterfaceType node) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept(this)) return true;
}
return false;
}
@override
bool visitTypedefType(TypedefType node) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept(this)) return true;
}
return false;
}
@override
bool visitTypeParameterType(TypeParameterType node) => false;
@override
bool visitIntersectionType(IntersectionType node) {
return node.left.accept(this) || node.right.accept(this);
}
@override
bool visitDynamicType(DynamicType node) => false;
@override
bool visitExtensionType(ExtensionType node) {
for (DartType typeArgument in node.typeArguments) {
if (typeArgument.accept(this)) return true;
}
return false;
}
@override
bool visitFutureOrType(FutureOrType node) {
return node.typeArgument.accept(this);
}
@override
bool visitInvalidType(InvalidType node) => false;
@override
bool visitNeverType(NeverType node) => false;
@override
bool visitNullType(NullType node) => false;
@override
bool visitRecordType(RecordType node) {
for (DartType parameterType in node.positional) {
if (parameterType.accept(this)) return true;
}
for (NamedType namedParameterType in node.named) {
if (namedParameterType.type.accept(this)) return true;
}
return false;
}
@override
bool visitVoidType(VoidType node) => false;
}
+8 -166
View File
@@ -6,6 +6,7 @@ library kernel.type_algebra;
import 'ast.dart';
import 'core_types.dart';
import 'src/find_type_visitor.dart';
import 'src/replacement_visitor.dart';
/// Returns all free type variables in [type].
@@ -889,7 +890,7 @@ class _DeepTypeSubstitutor extends _InnerTypeSubstitutor {
}
}
class _OccurrenceVisitor implements DartTypeVisitor<bool> {
class _OccurrenceVisitor extends FindTypeVisitor {
final Set<TypeParameter> variables;
/// Helper function invoked on unknown implementers of [DartType].
@@ -903,7 +904,7 @@ class _OccurrenceVisitor implements DartTypeVisitor<bool> {
_OccurrenceVisitor(this.variables, {this.unhandledTypeHandler});
bool visit(DartType node) => node.accept(this);
bool visit(DartType type) => type.accept(this);
bool visitNamedType(NamedType node) {
return visit(node.type);
@@ -918,37 +919,6 @@ class _OccurrenceVisitor implements DartTypeVisitor<bool> {
}
}
@override
bool visitNeverType(NeverType node) => false;
@override
bool visitNullType(NullType node) => false;
@override
bool visitInvalidType(InvalidType node) => false;
@override
bool visitDynamicType(DynamicType node) => false;
@override
bool visitVoidType(VoidType node) => false;
@override
bool visitInterfaceType(InterfaceType node) {
return node.typeArguments.any(visit);
}
@override
bool visitExtensionType(ExtensionType node) {
return node.typeArguments.any(visit);
}
@override
bool visitFutureOrType(FutureOrType node) {
return visit(node.typeArgument);
}
@override
bool visitTypedefType(TypedefType node) {
return node.typeArguments.any(visit);
}
@override
bool visitFunctionType(FunctionType node) {
return node.typeParameters.any(handleTypeParameter) ||
@@ -957,21 +927,11 @@ class _OccurrenceVisitor implements DartTypeVisitor<bool> {
visit(node.returnType);
}
@override
bool visitRecordType(RecordType node) {
return node.positional.any(visit) || node.named.any(visitNamedType);
}
@override
bool visitTypeParameterType(TypeParameterType node) {
return variables.contains(node.parameter);
}
@override
bool visitIntersectionType(IntersectionType node) {
return visit(node.left) || visit(node.right);
}
bool handleTypeParameter(TypeParameter node) {
assert(!variables.contains(node));
if (node.bound.accept(this)) return true;
@@ -979,166 +939,48 @@ class _OccurrenceVisitor implements DartTypeVisitor<bool> {
}
}
class _FreeFunctionTypeVariableVisitor implements DartTypeVisitor<bool> {
class _FreeFunctionTypeVariableVisitor extends FindTypeVisitor {
final Set<TypeParameter> variables = new Set<TypeParameter>();
_FreeFunctionTypeVariableVisitor();
bool visit(DartType node) => node.accept(this);
@override
bool defaultDartType(DartType node) {
throw new UnsupportedError("Unsupported type $node (${node.runtimeType}).");
}
bool visitNamedType(NamedType node) {
return visit(node.type);
}
@override
bool visitNeverType(NeverType node) => false;
@override
bool visitNullType(NullType node) => false;
@override
bool visitInvalidType(InvalidType node) => false;
@override
bool visitDynamicType(DynamicType node) => false;
@override
bool visitVoidType(VoidType node) => false;
@override
bool visitInterfaceType(InterfaceType node) {
return node.typeArguments.any(visit);
}
@override
bool visitExtensionType(ExtensionType node) {
return node.typeArguments.any(visit);
}
@override
bool visitFutureOrType(FutureOrType node) {
return visit(node.typeArgument);
}
@override
bool visitTypedefType(TypedefType node) {
return node.typeArguments.any(visit);
}
@override
bool visitFunctionType(FunctionType node) {
variables.addAll(node.typeParameters);
bool result = node.typeParameters.any(handleTypeParameter) ||
node.positionalParameters.any(visit) ||
node.namedParameters.any(visitNamedType) ||
visit(node.returnType);
bool result = super.visitFunctionType(node);
variables.removeAll(node.typeParameters);
return result;
}
@override
bool visitRecordType(RecordType node) {
return node.positional.any(visit) || node.named.any(visitNamedType);
}
@override
bool visitTypeParameterType(TypeParameterType node) {
return node.parameter.declaration == null &&
!variables.contains(node.parameter);
}
@override
bool visitIntersectionType(IntersectionType node) {
return visit(node.left) || visit(node.right);
}
bool handleTypeParameter(TypeParameter node) {
assert(variables.contains(node));
if (node.bound.accept(this)) return true;
return node.defaultType.accept(this);
}
}
class _FreeTypeVariableVisitor implements DartTypeVisitor<bool> {
class _FreeTypeVariableVisitor extends FindTypeVisitor {
final Set<TypeParameter> boundVariables;
_FreeTypeVariableVisitor({Set<TypeParameter>? boundVariables})
: this.boundVariables = boundVariables ?? <TypeParameter>{};
bool visit(DartType node) => node.accept(this);
@override
bool defaultDartType(DartType node) {
throw new UnsupportedError("Unsupported type $node (${node.runtimeType}.");
}
bool visitNamedType(NamedType node) {
return visit(node.type);
}
@override
bool visitNeverType(NeverType node) => false;
@override
bool visitNullType(NullType node) => false;
@override
bool visitInvalidType(InvalidType node) => false;
@override
bool visitDynamicType(DynamicType node) => false;
@override
bool visitVoidType(VoidType node) => false;
@override
bool visitInterfaceType(InterfaceType node) {
return node.typeArguments.any(visit);
}
@override
bool visitExtensionType(ExtensionType node) {
return node.typeArguments.any(visit);
}
@override
bool visitFutureOrType(FutureOrType node) {
return visit(node.typeArgument);
}
@override
bool visitTypedefType(TypedefType node) {
return node.typeArguments.any(visit);
}
bool visit(DartType type) => type.accept(this);
@override
bool visitFunctionType(FunctionType node) {
boundVariables.addAll(node.typeParameters);
bool result = node.typeParameters.any(handleTypeParameter) ||
node.positionalParameters.any(visit) ||
node.namedParameters.any(visitNamedType) ||
visit(node.returnType);
bool result = super.visitFunctionType(node);
boundVariables.removeAll(node.typeParameters);
return result;
}
@override
bool visitRecordType(RecordType node) {
return node.positional.any(visit) || node.named.any(visitNamedType);
}
@override
bool visitTypeParameterType(TypeParameterType node) {
return !boundVariables.contains(node.parameter);
}
@override
bool visitIntersectionType(IntersectionType node) {
return visit(node.left) && visit(node.right);
}
bool handleTypeParameter(TypeParameter node) {
assert(boundVariables.contains(node));
if (node.bound.accept(this)) return true;
return node.defaultType.accept(this);
}
}
Nullability uniteNullabilities(Nullability a, Nullability b) {
+66
View File
@@ -901,42 +901,108 @@ abstract class TreeVisitor1<R, A>
abstract class DartTypeVisitor<R> {
const DartTypeVisitor();
// TODO(johnniwinther): Remove this.
R defaultDartType(DartType node);
R visitInvalidType(InvalidType node);
R visitDynamicType(DynamicType node);
R visitVoidType(VoidType node);
R visitInterfaceType(InterfaceType node);
R visitFutureOrType(FutureOrType node);
R visitFunctionType(FunctionType node);
R visitTypeParameterType(TypeParameterType node);
R visitTypedefType(TypedefType node);
R visitNeverType(NeverType node);
R visitNullType(NullType node);
R visitExtensionType(ExtensionType node);
R visitIntersectionType(IntersectionType node);
R visitRecordType(RecordType node);
}
mixin DartTypeVisitorDefaultMixin<R> implements DartTypeVisitor<R> {
@override
R defaultDartType(DartType node);
@override
R visitInvalidType(InvalidType node) => defaultDartType(node);
@override
R visitDynamicType(DynamicType node) => defaultDartType(node);
@override
R visitVoidType(VoidType node) => defaultDartType(node);
@override
R visitInterfaceType(InterfaceType node) => defaultDartType(node);
@override
R visitFutureOrType(FutureOrType node) => defaultDartType(node);
@override
R visitFunctionType(FunctionType node) => defaultDartType(node);
@override
R visitTypeParameterType(TypeParameterType node) => defaultDartType(node);
@override
R visitTypedefType(TypedefType node) => defaultDartType(node);
@override
R visitNeverType(NeverType node) => defaultDartType(node);
@override
R visitNullType(NullType node) => defaultDartType(node);
@override
R visitExtensionType(ExtensionType node) => defaultDartType(node);
@override
R visitIntersectionType(IntersectionType node) => defaultDartType(node);
@override
R visitRecordType(RecordType node) => defaultDartType(node);
}
abstract class DartTypeVisitor1<R, A> {
const DartTypeVisitor1();
// TODO(johnniwinther): Remove this.
R defaultDartType(DartType node, A arg);
R visitInvalidType(InvalidType node, A arg);
R visitDynamicType(DynamicType node, A arg);
R visitVoidType(VoidType node, A arg);
R visitInterfaceType(InterfaceType node, A arg);
R visitFutureOrType(FutureOrType node, A arg);
R visitFunctionType(FunctionType node, A arg);
R visitTypeParameterType(TypeParameterType node, A arg);
R visitTypedefType(TypedefType node, A arg);
R visitNeverType(NeverType node, A arg);
R visitNullType(NullType node, A arg);
R visitExtensionType(ExtensionType node, A arg);
R visitIntersectionType(IntersectionType node, A arg);
R visitRecordType(RecordType node, A arg);
}
mixin DartTypeVisitor1DefaultMixin<R, A> implements DartTypeVisitor1<R, A> {
@override
R defaultDartType(DartType node, A arg);
@override
R visitInvalidType(InvalidType node, A arg) => defaultDartType(node, arg);
@override
R visitDynamicType(DynamicType node, A arg) => defaultDartType(node, arg);
@override
R visitVoidType(VoidType node, A arg) => defaultDartType(node, arg);
@override
R visitInterfaceType(InterfaceType node, A arg) => defaultDartType(node, arg);
@override
R visitFutureOrType(FutureOrType node, A arg) => defaultDartType(node, arg);
@override
R visitFunctionType(FunctionType node, A arg) => defaultDartType(node, arg);
@override
R visitTypeParameterType(TypeParameterType node, A arg) =>
defaultDartType(node, arg);
@override
R visitTypedefType(TypedefType node, A arg) => defaultDartType(node, arg);
@override
R visitNeverType(NeverType node, A arg) => defaultDartType(node, arg);
@override
R visitNullType(NullType node, A arg) => defaultDartType(node, arg);
@override
R visitExtensionType(ExtensionType node, A arg) => defaultDartType(node, arg);
@override
R visitIntersectionType(IntersectionType node, A arg) =>
defaultDartType(node, arg);
@override
R visitRecordType(RecordType node, A arg) => defaultDartType(node, arg);
}
@@ -2505,6 +2505,7 @@ class SummaryCollector extends RecursiveResultVisitor<TypeExpr?> {
}
class RuntimeTypeTranslatorImpl extends DartTypeVisitor<TypeExpr>
with DartTypeVisitorDefaultMixin<TypeExpr>
implements RuntimeTypeTranslator {
final CoreTypes coreTypes;
final Summary? summary;