aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/op.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-03-21 21:20:03 +0000
committerFlorian Diebold <[email protected]>2019-03-21 21:20:03 +0000
commitf10f5a81b326d161d9ed1fba263de972b89de2bf (patch)
treef54d83e74161c51cf8525213bf221b83d276de85 /crates/ra_hir/src/ty/op.rs
parent8a5fbf471305894094726834f7701747fce9c961 (diff)
TypeName => TypeCtor
Diffstat (limited to 'crates/ra_hir/src/ty/op.rs')
-rw-r--r--crates/ra_hir/src/ty/op.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_hir/src/ty/op.rs b/crates/ra_hir/src/ty/op.rs
index f581004d2..1d230140b 100644
--- a/crates/ra_hir/src/ty/op.rs
+++ b/crates/ra_hir/src/ty/op.rs
@@ -1,5 +1,5 @@
1use crate::{ ty::ApplicationTy, expr::BinaryOp}; 1use crate::{ ty::ApplicationTy, expr::BinaryOp};
2use super::{Ty, TypeName, InferTy}; 2use super::{Ty, TypeCtor, InferTy};
3 3
4pub(super) fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty { 4pub(super) fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty {
5 match op { 5 match op {
@@ -10,7 +10,7 @@ pub(super) fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty {
10 | BinaryOp::LesserEqualTest 10 | BinaryOp::LesserEqualTest
11 | BinaryOp::GreaterEqualTest 11 | BinaryOp::GreaterEqualTest
12 | BinaryOp::LesserTest 12 | BinaryOp::LesserTest
13 | BinaryOp::GreaterTest => Ty::simple(TypeName::Bool), 13 | BinaryOp::GreaterTest => Ty::simple(TypeCtor::Bool),
14 BinaryOp::Assignment 14 BinaryOp::Assignment
15 | BinaryOp::AddAssign 15 | BinaryOp::AddAssign
16 | BinaryOp::SubAssign 16 | BinaryOp::SubAssign
@@ -33,7 +33,7 @@ pub(super) fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty {
33 | BinaryOp::BitwiseOr 33 | BinaryOp::BitwiseOr
34 | BinaryOp::BitwiseXor => match rhs_ty { 34 | BinaryOp::BitwiseXor => match rhs_ty {
35 Ty::Apply(ApplicationTy { name, .. }) => match name { 35 Ty::Apply(ApplicationTy { name, .. }) => match name {
36 TypeName::Int(..) | TypeName::Float(..) => rhs_ty, 36 TypeCtor::Int(..) | TypeCtor::Float(..) => rhs_ty,
37 _ => Ty::Unknown, 37 _ => Ty::Unknown,
38 }, 38 },
39 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => rhs_ty, 39 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => rhs_ty,
@@ -45,14 +45,14 @@ pub(super) fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty {
45 45
46pub(super) fn binary_op_rhs_expectation(op: BinaryOp, lhs_ty: Ty) -> Ty { 46pub(super) fn binary_op_rhs_expectation(op: BinaryOp, lhs_ty: Ty) -> Ty {
47 match op { 47 match op {
48 BinaryOp::BooleanAnd | BinaryOp::BooleanOr => Ty::simple(TypeName::Bool), 48 BinaryOp::BooleanAnd | BinaryOp::BooleanOr => Ty::simple(TypeCtor::Bool),
49 BinaryOp::Assignment | BinaryOp::EqualityTest => match lhs_ty { 49 BinaryOp::Assignment | BinaryOp::EqualityTest => match lhs_ty {
50 Ty::Apply(ApplicationTy { name, .. }) => match name { 50 Ty::Apply(ApplicationTy { name, .. }) => match name {
51 TypeName::Int(..) 51 TypeCtor::Int(..)
52 | TypeName::Float(..) 52 | TypeCtor::Float(..)
53 | TypeName::Str 53 | TypeCtor::Str
54 | TypeName::Char 54 | TypeCtor::Char
55 | TypeName::Bool => lhs_ty, 55 | TypeCtor::Bool => lhs_ty,
56 _ => Ty::Unknown, 56 _ => Ty::Unknown,
57 }, 57 },
58 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => lhs_ty, 58 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => lhs_ty,
@@ -83,7 +83,7 @@ pub(super) fn binary_op_rhs_expectation(op: BinaryOp, lhs_ty: Ty) -> Ty {
83 | BinaryOp::BitwiseOr 83 | BinaryOp::BitwiseOr
84 | BinaryOp::BitwiseXor => match lhs_ty { 84 | BinaryOp::BitwiseXor => match lhs_ty {
85 Ty::Apply(ApplicationTy { name, .. }) => match name { 85 Ty::Apply(ApplicationTy { name, .. }) => match name {
86 TypeName::Int(..) | TypeName::Float(..) => lhs_ty, 86 TypeCtor::Int(..) | TypeCtor::Float(..) => lhs_ty,
87 _ => Ty::Unknown, 87 _ => Ty::Unknown,
88 }, 88 },
89 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => lhs_ty, 89 Ty::Infer(InferTy::IntVar(..)) | Ty::Infer(InferTy::FloatVar(..)) => lhs_ty,