@@ -1688,7 +1688,7 @@ impl<'db> TypeInferenceBuilder<'db> {
1688
1688
ast:: Number :: Int ( n) => n
1689
1689
. as_i64 ( )
1690
1690
. map ( Type :: IntLiteral )
1691
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
1691
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
1692
1692
ast:: Number :: Float ( _) => builtins_symbol_ty ( self . db , "float" ) . to_instance ( self . db ) ,
1693
1693
ast:: Number :: Complex { .. } => {
1694
1694
builtins_symbol_ty ( self . db , "complex" ) . to_instance ( self . db )
@@ -2327,17 +2327,17 @@ impl<'db> TypeInferenceBuilder<'db> {
2327
2327
( Type :: IntLiteral ( n) , Type :: IntLiteral ( m) , ast:: Operator :: Add ) => n
2328
2328
. checked_add ( m)
2329
2329
. map ( Type :: IntLiteral )
2330
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
2330
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
2331
2331
2332
2332
( Type :: IntLiteral ( n) , Type :: IntLiteral ( m) , ast:: Operator :: Sub ) => n
2333
2333
. checked_sub ( m)
2334
2334
. map ( Type :: IntLiteral )
2335
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
2335
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
2336
2336
2337
2337
( Type :: IntLiteral ( n) , Type :: IntLiteral ( m) , ast:: Operator :: Mult ) => n
2338
2338
. checked_mul ( m)
2339
2339
. map ( Type :: IntLiteral )
2340
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
2340
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
2341
2341
2342
2342
( Type :: IntLiteral ( _) , Type :: IntLiteral ( _) , ast:: Operator :: Div ) => {
2343
2343
builtins_symbol_ty ( self . db , "float" ) . to_instance ( self . db )
@@ -2346,12 +2346,12 @@ impl<'db> TypeInferenceBuilder<'db> {
2346
2346
( Type :: IntLiteral ( n) , Type :: IntLiteral ( m) , ast:: Operator :: FloorDiv ) => n
2347
2347
. checked_div ( m)
2348
2348
. map ( Type :: IntLiteral )
2349
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
2349
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
2350
2350
2351
2351
( Type :: IntLiteral ( n) , Type :: IntLiteral ( m) , ast:: Operator :: Mod ) => n
2352
2352
. checked_rem ( m)
2353
2353
. map ( Type :: IntLiteral )
2354
- . unwrap_or_else ( || builtins_symbol_ty ( self . db , "int" ) . to_instance ( self . db ) ) ,
2354
+ . unwrap_or_else ( || Type :: builtin_int_instance ( self . db ) ) ,
2355
2355
2356
2356
( Type :: BytesLiteral ( lhs) , Type :: BytesLiteral ( rhs) , ast:: Operator :: Add ) => {
2357
2357
Type :: BytesLiteral ( BytesLiteralType :: new (
@@ -2911,7 +2911,7 @@ impl StringPartsCollector {
2911
2911
2912
2912
fn ty ( self , db : & dyn Db ) -> Type {
2913
2913
if self . expression {
2914
- Type :: builtin_str ( db ) . to_instance ( db)
2914
+ Type :: builtin_str_instance ( db)
2915
2915
} else if let Some ( concatenated) = self . concatenated {
2916
2916
Type :: StringLiteral ( StringLiteralType :: new ( db, concatenated. into_boxed_str ( ) ) )
2917
2917
} else {
0 commit comments