pull/12314/head
			
			
		
		
							parent
							
								
									159a9c3070
								
							
						
					
					
						commit
						43fbc68f1e
					
				|  | @ -3711,6 +3711,12 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) { | |||
| 				right_len = 0 | ||||
| 			} | ||||
| 		} | ||||
| 		if right is ast.InfixExpr { | ||||
| 			if right.op == .arrow { | ||||
| 				c.error('cannot use `<-` on the right-hand side of an assignment, as it does not return any values', | ||||
| 					right.pos) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	if node.left.len != right_len { | ||||
| 		if right_first is ast.CallExpr { | ||||
|  |  | |||
|  | @ -0,0 +1,4 @@ | |||
| vlib/v/checker/tests/assign_expr_channel_push.vv:2:9: error: cannot use `<-` on the right-hand side of an assignment, as it does not return any values | ||||
|     1 | ch := chan f64{} | ||||
|     2 | _ := ch <- 4.56 | ||||
|       | | ||||
|  | @ -0,0 +1,2 @@ | |||
| ch := chan f64{} | ||||
| _ := ch <- 4.56 | ||||
		Loading…
	
		Reference in New Issue