@@ -387,7 +387,19 @@ impl PythonValidator {
387387 ) , & session. current_noqa ) ;
388388 continue ;
389389 }
390- let field_type = symbol. borrow ( ) . name ( ) . clone ( ) ;
390+ let Some ( field_type) = symbol
391+ . borrow ( )
392+ . get_member_symbol ( session, & S ! ( "type" ) , None , false , false , false , false )
393+ . 0 . first ( )
394+ . and_then ( |field_type_var| field_type_var. borrow ( ) . evaluations ( ) . cloned ( ) )
395+ . and_then ( |evals| evals. first ( ) . cloned ( ) )
396+ . and_then ( |eval| eval. value . clone ( ) )
397+ . and_then ( |value| match value {
398+ EvaluationValue :: CONSTANT ( Expr :: StringLiteral ( s) ) => Some ( s. value . to_string ( ) ) ,
399+ _ => None ,
400+ } ) else {
401+ continue ;
402+ } ;
391403 let found_same_type_match = syms. iter ( ) . any ( |sym|{
392404 let related_eval_weaks = Symbol :: follow_ref ( & & EvaluationSymbolPtr :: WEAK ( EvaluationSymbolWeak :: new (
393405 Rc :: downgrade ( & sym) ,
@@ -398,8 +410,16 @@ impl PythonValidator {
398410 let Some ( related_field_class_sym) = related_eval_weak. upgrade_weak ( ) else {
399411 return false
400412 } ;
401- let same_field = related_field_class_sym. borrow ( ) . is_specific_field_class ( session, & [ field_type. as_str ( ) ] ) ;
402- same_field
413+ let found = related_field_class_sym
414+ . borrow ( )
415+ . get_member_symbol ( session, & S ! ( "type" ) , None , false , false , false , false )
416+ . 0 . first ( )
417+ . and_then ( |field_type_var| field_type_var. borrow ( ) . evaluations ( ) . cloned ( ) )
418+ . and_then ( |evals| evals. first ( ) . cloned ( ) )
419+ . and_then ( |eval| eval. value . clone ( ) )
420+ . map ( |value| matches ! ( value, EvaluationValue :: CONSTANT ( Expr :: StringLiteral ( s) ) if s. value. to_string( ) == field_type) )
421+ . unwrap_or ( false ) ;
422+ found
403423 } )
404424 } ) ;
405425 if !found_same_type_match{
0 commit comments