diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc index 12c48e75662..3c8a85308a9 100644 --- a/runtime/vm/class_finalizer.cc +++ b/runtime/vm/class_finalizer.cc @@ -639,7 +639,13 @@ void ClassFinalizer::CheckRecursiveType(const Class& cls, const TypeArguments& arguments = TypeArguments::Handle(zone, type.arguments()); // A type can only be recursive via its type arguments. - ASSERT(!arguments.IsNull()); + if (arguments.IsNull()) { + // However, Kernel does not keep the relation between a function type and + // its declaring typedef. Therefore, a typedef-declared function type may + // refer to the still unfinalized typedef via a type in its signature. + ASSERT(type.IsFunctionType()); + return; + } const intptr_t num_type_args = arguments.Length(); ASSERT(num_type_args > 0); ASSERT(num_type_args == type_cls.NumTypeArguments()); @@ -1100,7 +1106,7 @@ void ClassFinalizer::CheckTypeArgumentBounds(const Class& cls, } } AbstractType& super_type = AbstractType::Handle(cls.super_type()); - if (!super_type.IsNull()) { + if (!super_type.IsNull() && !super_type.IsBeingFinalized()) { const Class& super_class = Class::Handle(super_type.type_class()); CheckTypeArgumentBounds(super_class, arguments, bound_error); } diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index 8f3b76af127..42b5f1b7e28 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -493,11 +493,6 @@ mixin_supertype_subclass_test/05: MissingCompileTimeError [ $compiler == dartk && $mode == debug && $runtime == vm && $strong ] const_instance_field_test/01: Crash # Issue 32326. -cyclic_type_variable_test/01: Crash -cyclic_type_variable_test/02: Crash -cyclic_type_variable_test/03: Crash -cyclic_type_variable_test/04: Crash -cyclic_type_variable_test/none: Crash deopt_inlined_function_lazy_test: Skip tearoff_dynamic_test: Crash @@ -772,11 +767,6 @@ least_upper_bound_expansive_test/none: RuntimeError # Please triage. [ $compiler == dartkp && $mode == debug && $runtime == dart_precompiled && $strong ] const_instance_field_test/01: Crash # Issue 32326. -cyclic_type_variable_test/01: Crash -cyclic_type_variable_test/02: Crash -cyclic_type_variable_test/03: Crash -cyclic_type_variable_test/04: Crash -cyclic_type_variable_test/none: Crash external_test/13: Crash regress_29025_test: Crash tearoff_dynamic_test: Crash