@@ -5007,21 +5007,23 @@ impl<'db> Type<'db> {
50075007 | Type :: ProtocolInstance ( _)
50085008 | Type :: PropertyInstance ( _)
50095009 | Type :: TypeIs ( _) => Err ( InvalidTypeExpressionError {
5010- invalid_expressions : smallvec:: smallvec! [ InvalidTypeExpression :: InvalidType (
5011- * self , scope_id
5012- ) ] ,
5010+ invalid_expressions : smallvec:: smallvec_inline! [
5011+ InvalidTypeExpression :: InvalidType ( * self , scope_id)
5012+ ] ,
50135013 fallback_type : Type :: unknown ( ) ,
50145014 } ) ,
50155015
50165016 Type :: KnownInstance ( known_instance) => match known_instance {
50175017 KnownInstanceType :: TypeAliasType ( alias) => Ok ( alias. value_type ( db) ) ,
50185018 KnownInstanceType :: TypeVar ( typevar) => Ok ( Type :: TypeVar ( * typevar) ) ,
50195019 KnownInstanceType :: SubscriptedProtocol ( _) => Err ( InvalidTypeExpressionError {
5020- invalid_expressions : smallvec:: smallvec![ InvalidTypeExpression :: Protocol ] ,
5020+ invalid_expressions : smallvec:: smallvec_inline![
5021+ InvalidTypeExpression :: Protocol
5022+ ] ,
50215023 fallback_type : Type :: unknown ( ) ,
50225024 } ) ,
50235025 KnownInstanceType :: SubscriptedGeneric ( _) => Err ( InvalidTypeExpressionError {
5024- invalid_expressions : smallvec:: smallvec ![ InvalidTypeExpression :: Generic ] ,
5026+ invalid_expressions : smallvec:: smallvec_inline ![ InvalidTypeExpression :: Generic ] ,
50255027 fallback_type : Type :: unknown ( ) ,
50265028 } ) ,
50275029 } ,
@@ -5057,7 +5059,7 @@ impl<'db> Type<'db> {
50575059 let Some ( class) = nearest_enclosing_class ( db, index, scope_id, & module) else {
50585060 return Err ( InvalidTypeExpressionError {
50595061 fallback_type : Type :: unknown ( ) ,
5060- invalid_expressions : smallvec:: smallvec ![
5062+ invalid_expressions : smallvec:: smallvec_inline ![
50615063 InvalidTypeExpression :: InvalidType ( * self , scope_id)
50625064 ] ,
50635065 } ) ;
@@ -5081,18 +5083,20 @@ impl<'db> Type<'db> {
50815083 SpecialFormType :: Literal
50825084 | SpecialFormType :: Union
50835085 | SpecialFormType :: Intersection => Err ( InvalidTypeExpressionError {
5084- invalid_expressions : smallvec:: smallvec ![
5086+ invalid_expressions : smallvec:: smallvec_inline ![
50855087 InvalidTypeExpression :: RequiresArguments ( * self )
50865088 ] ,
50875089 fallback_type : Type :: unknown ( ) ,
50885090 } ) ,
50895091
50905092 SpecialFormType :: Protocol => Err ( InvalidTypeExpressionError {
5091- invalid_expressions : smallvec:: smallvec![ InvalidTypeExpression :: Protocol ] ,
5093+ invalid_expressions : smallvec:: smallvec_inline![
5094+ InvalidTypeExpression :: Protocol
5095+ ] ,
50925096 fallback_type : Type :: unknown ( ) ,
50935097 } ) ,
50945098 SpecialFormType :: Generic => Err ( InvalidTypeExpressionError {
5095- invalid_expressions : smallvec:: smallvec ![ InvalidTypeExpression :: Generic ] ,
5099+ invalid_expressions : smallvec:: smallvec_inline ![ InvalidTypeExpression :: Generic ] ,
50965100 fallback_type : Type :: unknown ( ) ,
50975101 } ) ,
50985102
@@ -5103,15 +5107,15 @@ impl<'db> Type<'db> {
51035107 | SpecialFormType :: TypeGuard
51045108 | SpecialFormType :: Unpack
51055109 | SpecialFormType :: CallableTypeOf => Err ( InvalidTypeExpressionError {
5106- invalid_expressions : smallvec:: smallvec ![
5110+ invalid_expressions : smallvec:: smallvec_inline ![
51075111 InvalidTypeExpression :: RequiresOneArgument ( * self )
51085112 ] ,
51095113 fallback_type : Type :: unknown ( ) ,
51105114 } ) ,
51115115
51125116 SpecialFormType :: Annotated | SpecialFormType :: Concatenate => {
51135117 Err ( InvalidTypeExpressionError {
5114- invalid_expressions : smallvec:: smallvec ![
5118+ invalid_expressions : smallvec:: smallvec_inline ![
51155119 InvalidTypeExpression :: RequiresTwoArguments ( * self )
51165120 ] ,
51175121 fallback_type : Type :: unknown ( ) ,
@@ -5120,7 +5124,7 @@ impl<'db> Type<'db> {
51205124
51215125 SpecialFormType :: ClassVar | SpecialFormType :: Final => {
51225126 Err ( InvalidTypeExpressionError {
5123- invalid_expressions : smallvec:: smallvec ![
5127+ invalid_expressions : smallvec:: smallvec_inline ![
51245128 InvalidTypeExpression :: TypeQualifier ( * special_form)
51255129 ] ,
51265130 fallback_type : Type :: unknown ( ) ,
@@ -5130,7 +5134,7 @@ impl<'db> Type<'db> {
51305134 SpecialFormType :: ReadOnly
51315135 | SpecialFormType :: NotRequired
51325136 | SpecialFormType :: Required => Err ( InvalidTypeExpressionError {
5133- invalid_expressions : smallvec:: smallvec ![
5137+ invalid_expressions : smallvec:: smallvec_inline ![
51345138 InvalidTypeExpression :: TypeQualifierRequiresOneArgument ( * special_form)
51355139 ] ,
51365140 fallback_type : Type :: unknown ( ) ,
@@ -5184,9 +5188,9 @@ impl<'db> Type<'db> {
51845188 "Support for `types.UnionType` instances in type expressions"
51855189 ) ) ,
51865190 _ => Err ( InvalidTypeExpressionError {
5187- invalid_expressions : smallvec:: smallvec! [ InvalidTypeExpression :: InvalidType (
5188- * self , scope_id
5189- ) ] ,
5191+ invalid_expressions : smallvec:: smallvec_inline! [
5192+ InvalidTypeExpression :: InvalidType ( * self , scope_id)
5193+ ] ,
51905194 fallback_type : Type :: unknown ( ) ,
51915195 } ) ,
51925196 } ,
0 commit comments