Skip to content

Commit

Permalink
docs: Try removing an unnecessarily complicated case
Browse files Browse the repository at this point in the history
Summary: I looked at all the cases where a `DocFunction` was constructed (`NativeCallable`, `Def`, and `RuleCallable`) and those starlark values already return a `typechecker_ty`, so this should be dead code

Reviewed By: stepancheg

Differential Revision: D60917925

fbshipit-source-id: 7d2940b9c8dae41e3e2491e55b4b4f0cbbf844a4
  • Loading branch information
JakobDegen authored and facebook-github-bot committed Aug 8, 2024
1 parent 4205420 commit 3ecc731
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions starlark-rust/starlark/src/typing/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ use starlark_syntax::syntax::type_expr::type_str_literal_is_wildcard;

use crate as starlark;
use crate::docs::DocFunction;
use crate::docs::DocItem;
use crate::docs::DocMember;
use crate::docs::DocParam;
use crate::eval::compiler::small_vec_1::SmallVec1;
use crate::typing::arc_ty::ArcTy;
Expand Down Expand Up @@ -476,11 +474,7 @@ impl Ty {
if let Some(t) = value.get_ref().typechecker_ty() {
t
} else {
match value.documentation() {
Some(DocItem::Member(DocMember::Function(x))) => Ty::from_docs_function(&x),
Some(DocItem::Member(DocMember::Property(x))) => x.typ.clone(),
_ => value.get_type_starlark_repr(),
}
value.get_type_starlark_repr()
}
}

Expand Down

0 comments on commit 3ecc731

Please sign in to comment.