@@ -85,13 +85,19 @@ def analyze_member_access(name: str, typ: Type, node: Context, is_lvalue: bool,
85
85
elif isinstance (typ , FunctionLike ) and typ .is_type_obj ():
86
86
# Class attribute.
87
87
# TODO super?
88
- itype = cast (Instance , typ .items ()[0 ].ret_type )
89
- result = analyze_class_attribute_access (itype , name , node , is_lvalue , builtin_type , msg )
90
- if result :
91
- return result
92
- # Look up from the 'type' type.
93
- return analyze_member_access (name , typ .fallback , node , is_lvalue , is_super ,
94
- builtin_type , msg , report_type = report_type )
88
+ ret_type = typ .items ()[0 ].ret_type
89
+ if isinstance (ret_type , TupleType ):
90
+ ret_type = ret_type .fallback
91
+ if isinstance (ret_type , Instance ):
92
+ result = analyze_class_attribute_access (ret_type , name , node , is_lvalue ,
93
+ builtin_type , msg )
94
+ if result :
95
+ return result
96
+ # Look up from the 'type' type.
97
+ return analyze_member_access (name , typ .fallback , node , is_lvalue , is_super ,
98
+ builtin_type , msg , report_type = report_type )
99
+ else :
100
+ assert False , 'Unexpected type {}' .format (repr (ret_type ))
95
101
elif isinstance (typ , FunctionLike ):
96
102
# Look up from the 'function' type.
97
103
return analyze_member_access (name , typ .fallback , node , is_lvalue , is_super ,
0 commit comments