@@ -436,15 +436,17 @@ impl PythonArchEval {
436436 let symbol = eval_base. upgrade ( ) . unwrap ( ) ;
437437 if symbol. borrow ( ) . typ ( ) != SymType :: COMPILED {
438438 if symbol. borrow ( ) . typ ( ) != SymType :: CLASS {
439- self . diagnostics . push ( Diagnostic :: new (
440- Range :: new ( Position :: new ( base. start ( ) . to_u32 ( ) , 0 ) , Position :: new ( base. end ( ) . to_u32 ( ) , 0 ) ) ,
441- Some ( DiagnosticSeverity :: WARNING ) ,
442- Some ( NumberOrString :: String ( S ! ( "OLS20003" ) ) ) ,
443- Some ( EXTENSION_NAME . to_string ( ) ) ,
444- format ! ( "Base class {} is not a class" , AstUtils :: flatten_expr( base) ) ,
445- None ,
446- None ,
447- ) ) ;
439+ if symbol. borrow ( ) . typ ( ) != SymType :: VARIABLE { //we followed_ref already, so if it's still a variable, it means we can't evaluate it. Skip diagnostic
440+ self . diagnostics . push ( Diagnostic :: new (
441+ Range :: new ( Position :: new ( base. start ( ) . to_u32 ( ) , 0 ) , Position :: new ( base. end ( ) . to_u32 ( ) , 0 ) ) ,
442+ Some ( DiagnosticSeverity :: WARNING ) ,
443+ Some ( NumberOrString :: String ( S ! ( "OLS20003" ) ) ) ,
444+ Some ( EXTENSION_NAME . to_string ( ) ) ,
445+ format ! ( "Base class {} is not a class" , AstUtils :: flatten_expr( base) ) ,
446+ None ,
447+ None ,
448+ ) ) ;
449+ }
448450 } else {
449451 let file_symbol = symbol. borrow ( ) . get_file ( ) . unwrap ( ) . upgrade ( ) . unwrap ( ) ;
450452 if !Rc :: ptr_eq ( & self . file , & file_symbol) {
0 commit comments