Skip to content

Commit 53c1895

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Rename has_type_attr -> is_type
Summary: This method is not used to describe now deprecated `.type` attribute, but used to check whether a function can be bit-ored with another type to make a union type. Reviewed By: perehonchuk Differential Revision: D63905238 fbshipit-source-id: 9a691f3aab261d4a94b8e47f08f4b1481672ba32
1 parent 7f4dc6c commit 53c1895

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: starlark/src/typing/function.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::values::typing::type_compiled::alloc::TypeMatcherAlloc;
3939
pub trait TyCustomFunctionImpl:
4040
Debug + Eq + Ord + Hash + Allocative + Send + Sync + 'static
4141
{
42-
fn has_type_attr(&self) -> bool {
42+
fn is_type(&self) -> bool {
4343
false
4444
}
4545

@@ -104,7 +104,7 @@ impl<F: TyCustomFunctionImpl> TyCustomImpl for TyCustomFunction<F> {
104104
) -> Result<Ty, TypingNoContextOrInternalError> {
105105
match bin_op {
106106
// `str | list`.
107-
TypingBinOp::BitOr if self.0.has_type_attr() => Ok(Ty::basic(TyBasic::Type)),
107+
TypingBinOp::BitOr if self.0.is_type() => Ok(Ty::basic(TyBasic::Type)),
108108
_ => Err(TypingNoContextOrInternalError::Typing),
109109
}
110110
}
@@ -161,7 +161,7 @@ impl TyFunction {
161161
}
162162

163163
impl TyCustomFunctionImpl for TyFunction {
164-
fn has_type_attr(&self) -> bool {
164+
fn is_type(&self) -> bool {
165165
self.type_attr.is_some()
166166
}
167167

Diff for: starlark/src/values/types/list/globals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static LIST: Lazy<TyFunction> = Lazy::new(|| {
5353
});
5454

5555
impl TyCustomFunctionImpl for ListType {
56-
fn has_type_attr(&self) -> bool {
56+
fn is_type(&self) -> bool {
5757
true
5858
}
5959

0 commit comments

Comments
 (0)