@@ -120,8 +120,9 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp
120
120
if ( ! argType . IsRecord )
121
121
{
122
122
if ( argCount >= 3 && i == argCount - 1 &&
123
- ( ( context . Features . PowerFxV1CompatibilityRules && BuiltInEnums . RemoveFlagsEnum . FormulaType . _type . Accepts ( argTypes [ i ] , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) ) ||
124
- ( ! context . Features . PowerFxV1CompatibilityRules && DType . String . Accepts ( argType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) ) ) )
123
+ ( ( ! context . AnalysisMode && BuiltInEnums . RemoveFlagsEnum . FormulaType . _type . Accepts ( argType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) ) ||
124
+ ( context . AnalysisMode && ( DType . String . Accepts ( argType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) ||
125
+ BuiltInEnums . RemoveFlagsEnum . FormulaType . _type . Accepts ( argType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) ) ) ) )
125
126
{
126
127
continue ;
127
128
}
@@ -140,30 +141,17 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp
140
141
( ! context . Features . PowerFxV1CompatibilityRules && ( ! collectionAcceptsRecord && ! recordAcceptsCollection ) ) )
141
142
{
142
143
fValid = false ;
143
- SetErrorForMismatchedColumns ( collectionType , argType , args [ i ] , errors , context . Features ) ;
144
+ if ( ! SetErrorForMismatchedColumns ( collectionType , argType , args [ i ] , errors , context . Features ) )
145
+ {
146
+ errors . EnsureError ( DocumentErrorSeverity . Severe , args [ i ] , TexlStrings . ErrTableDoesNotAcceptThisType ) ;
147
+ }
144
148
}
145
149
146
150
// Only warn about no-op record inputs if there are no data sources that would use reference identity for comparison.
147
151
else if ( ! collectionType . AssociatedDataSources . Any ( ) && ! recordAcceptsCollection )
148
152
{
149
153
errors . EnsureError ( DocumentErrorSeverity . Warning , args [ i ] , TexlStrings . ErrCollectionDoesNotAcceptThisType ) ;
150
154
}
151
-
152
- if ( ! context . AnalysisMode )
153
- {
154
- // ArgType[N] (0<N<argCount) must match all the fields with the data source.
155
- bool checkAggregateNames = argType . CheckAggregateNames ( collectionType , args [ i ] , errors , context . Features , SupportsParamCoercion ) ;
156
-
157
- // The item schema should be compatible with the collection schema.
158
- if ( ! checkAggregateNames )
159
- {
160
- fValid = false ;
161
- if ( ! SetErrorForMismatchedColumns ( collectionType , argType , args [ i ] , errors , context . Features ) )
162
- {
163
- errors . EnsureError ( DocumentErrorSeverity . Severe , args [ i ] , TexlStrings . ErrTableDoesNotAcceptThisType ) ;
164
- }
165
- }
166
- }
167
155
}
168
156
169
157
returnType = context . Features . PowerFxV1CompatibilityRules ? DType . Void : collectionType ;
@@ -382,23 +370,8 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp
382
370
errors . EnsureError ( args [ 1 ] , TexlStrings . ErrNeedTable_Arg , args [ 1 ] ) ;
383
371
}
384
372
385
- if ( ! context . AnalysisMode )
386
- {
387
- bool checkAggregateNames = sourceType . CheckAggregateNames ( collectionType , args [ 1 ] , errors , context . Features , SupportsParamCoercion ) ;
388
-
389
- // The item schema should be compatible with the collection schema.
390
- if ( ! checkAggregateNames )
391
- {
392
- fValid = false ;
393
- if ( ! SetErrorForMismatchedColumns ( collectionType , sourceType , args [ 1 ] , errors , context . Features ) )
394
- {
395
- errors . EnsureError ( DocumentErrorSeverity . Severe , args [ 1 ] , TexlStrings . ErrTableDoesNotAcceptThisType ) ;
396
- }
397
- }
398
- }
399
-
400
373
// The source schema should be compatible with the collection schema.
401
- else if ( ! collectionType . Accepts ( sourceType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) && ! sourceType . Accepts ( collectionType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) )
374
+ if ( ! collectionType . Accepts ( sourceType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) && ! sourceType . Accepts ( collectionType , exact : true , useLegacyDateTimeAccepts : false , usePowerFxV1CompatibilityRules : context . Features . PowerFxV1CompatibilityRules ) )
402
375
{
403
376
fValid = false ;
404
377
if ( ! SetErrorForMismatchedColumns ( collectionType , sourceType , args [ 1 ] , errors , context . Features ) )
0 commit comments