@@ -29,8 +29,7 @@ use crate::{
29
29
expr:: {
30
30
HirArrayLiteral , HirBlockExpression , HirCallExpression , HirCastExpression ,
31
31
HirConstructorExpression , HirExpression , HirIdent , HirIfExpression , HirIndexExpression ,
32
- HirInfixExpression , HirLambda , HirLiteral , HirMemberAccess , HirMethodCallExpression ,
33
- HirPrefixExpression ,
32
+ HirInfixExpression , HirLambda , HirLiteral , HirMemberAccess , HirPrefixExpression ,
34
33
} ,
35
34
stmt:: {
36
35
HirAssignStatement , HirForStatement , HirLValue , HirLetStatement , HirPattern ,
@@ -528,15 +527,13 @@ impl<'local, 'interner> Interpreter<'local, 'interner> {
528
527
HirExpression :: Constructor ( constructor) => self . evaluate_constructor ( constructor, id) ,
529
528
HirExpression :: MemberAccess ( access) => self . evaluate_access ( access, id) ,
530
529
HirExpression :: Call ( call) => self . evaluate_call ( call, id) ,
531
- HirExpression :: MethodCall ( call) => self . evaluate_method_call ( call, id) ,
532
530
HirExpression :: Constrain ( constrain) => self . evaluate_constrain ( constrain) ,
533
531
HirExpression :: Cast ( cast) => self . evaluate_cast ( & cast, id) ,
534
532
HirExpression :: If ( if_) => self . evaluate_if ( if_, id) ,
535
533
HirExpression :: Match ( match_) => todo ! ( "Evaluate match in comptime code" ) ,
536
534
HirExpression :: Tuple ( tuple) => self . evaluate_tuple ( tuple) ,
537
535
HirExpression :: Lambda ( lambda) => self . evaluate_lambda ( lambda, id) ,
538
536
HirExpression :: Quote ( tokens) => self . evaluate_quote ( tokens, id) ,
539
- HirExpression :: Comptime ( block) => self . evaluate_block ( block) ,
540
537
HirExpression :: Unsafe ( block) => self . evaluate_block ( block) ,
541
538
HirExpression :: EnumConstructor ( constructor) => {
542
539
self . evaluate_enum_constructor ( constructor, id)
@@ -1369,33 +1366,6 @@ impl<'local, 'interner> Interpreter<'local, 'interner> {
1369
1366
} ) ;
1370
1367
}
1371
1368
1372
- fn evaluate_method_call (
1373
- & mut self ,
1374
- call : HirMethodCallExpression ,
1375
- id : ExprId ,
1376
- ) -> IResult < Value > {
1377
- let object = self . evaluate ( call. object ) ?;
1378
- let arguments = try_vecmap ( call. arguments , |arg| {
1379
- Ok ( ( self . evaluate ( arg) ?, self . elaborator . interner . expr_location ( & arg) ) )
1380
- } ) ?;
1381
- let location = self . elaborator . interner . expr_location ( & id) ;
1382
-
1383
- let typ = object. get_type ( ) . follow_bindings ( ) ;
1384
- let method_name = & call. method . 0 . contents ;
1385
- let check_self_param = true ;
1386
-
1387
- let method = self
1388
- . elaborator
1389
- . lookup_method ( & typ, method_name, location, check_self_param)
1390
- . and_then ( |method| method. func_id ( self . elaborator . interner ) ) ;
1391
-
1392
- if let Some ( method) = method {
1393
- self . call_function ( method, arguments, TypeBindings :: new ( ) , location)
1394
- } else {
1395
- Err ( InterpreterError :: NoMethodFound { name : method_name. clone ( ) , typ, location } )
1396
- }
1397
- }
1398
-
1399
1369
fn evaluate_cast ( & mut self , cast : & HirCastExpression , id : ExprId ) -> IResult < Value > {
1400
1370
let evaluated_lhs = self . evaluate ( cast. lhs ) ?;
1401
1371
let location = self . elaborator . interner . expr_location ( & id) ;
0 commit comments