@@ -628,6 +628,9 @@ class SummaryCollector extends RecursiveResultVisitor<TypeExpr?> {
628628 summaryName += '::${localFunctionName (localFunction )}' ;
629629 }
630630 debugPrint ("===== $summaryName =====" );
631+ if (_enclosingMember != null ) {
632+ throw 'Unable to create summary recursively, previous: $_enclosingMember , current: $summaryName ' ;
633+ }
631634 assert (! member.isAbstract);
632635 _enclosingMember = member;
633636
@@ -2926,11 +2929,13 @@ class ConstantAllocationCollector implements ConstantVisitor<Type> {
29262929 for (int i = 0 ; i < constant.positional.length; ++ i) {
29272930 final Field f = epl.getRecordPositionalField (recordShape, i);
29282931 final Type value = typeFor (constant.positional[i]);
2932+ assert (! f.isCovariantByClass);
29292933 epl.addFieldUsedInConstant (f, receiver, value);
29302934 }
29312935 constant.named.forEach ((String fieldName, Constant fieldValue) {
29322936 final Field f = epl.getRecordNamedField (recordShape, fieldName);
29332937 final Type value = typeFor (fieldValue);
2938+ assert (! f.isCovariantByClass);
29342939 epl.addFieldUsedInConstant (f, receiver, value);
29352940 });
29362941 return receiver;
@@ -2941,6 +2946,7 @@ class ConstantAllocationCollector implements ConstantVisitor<Type> {
29412946 final resultClass = summaryCollector._entryPointsListener
29422947 .addAllocatedClass (constant.classNode);
29432948 constant.fieldValues.forEach ((Reference fieldReference, Constant value) {
2949+ assert (! fieldReference.asField.isCovariantByClass);
29442950 summaryCollector._entryPointsListener.addFieldUsedInConstant (
29452951 fieldReference.asField, resultClass, typeFor (value));
29462952 });
0 commit comments