@@ -268,13 +268,7 @@ internal async Task<Evaluation> EvaluateAsync(DataGeneratorMetadata dataGenerato
268268 var row = await rowFactory ( ) . ConfigureAwait ( false ) is { } fetched ? EvaluateWrappedFactory ( fetched ) : null ;
269269 // Fixed declared row types infer through constructor positions, not necessarily
270270 // the first runtime value. Own-class sources can also infer from null values.
271- var source = dataSources [ index ] ;
272- var infers = DeclaredRowTypes . TryGetValue ( source , out var argumentTypes )
273- ? argumentTypes . SequenceEqual ( ClassTypeArguments )
274- : source is MethodDataSourceAttribute { InferredClassTypeArguments : { } declared } methodSource
275- ? row is { Length : > 0 } && declared . SequenceEqual ( ClassTypeArguments )
276- && ( methodSource . ClassProvidingDataSource is null || HasNonNullValues ( row ) )
277- : InfersTypeArguments ( row , ClassTypeArguments ) ;
271+ var infers = RowInfers ( dataSources [ index ] , row , ClassTypeArguments ) ;
278272 anyRowInfers |= infers ;
279273 rows . Add ( new EvaluatedRow ( rowFactory , row , infers ) ) ;
280274 }
@@ -286,6 +280,22 @@ internal async Task<Evaluation> EvaluateAsync(DataGeneratorMetadata dataGenerato
286280 }
287281 }
288282
283+ private static bool RowInfers ( IDataSourceAttribute source , object ? [ ] ? row , Type [ ] classTypeArguments )
284+ {
285+ if ( DeclaredRowTypes . TryGetValue ( source , out var argumentTypes ) )
286+ {
287+ return argumentTypes . SequenceEqual ( classTypeArguments ) ;
288+ }
289+
290+ if ( source is MethodDataSourceAttribute { InferredClassTypeArguments : { } declared } methodSource )
291+ {
292+ return row is { Length : > 0 } && declared . SequenceEqual ( classTypeArguments )
293+ && ( methodSource . ClassProvidingDataSource is null || HasNonNullValues ( row ) ) ;
294+ }
295+
296+ return InfersTypeArguments ( row , classTypeArguments ) ;
297+ }
298+
289299 /// <summary>
290300 /// One build's evaluation, started by the first wrapper that reads it, and the number of the build's
291301 /// wrappers that have not read it yet.
0 commit comments