Skip to content

Commit

Permalink
Get rid of option to approximate maps (always true)
Browse files Browse the repository at this point in the history
Summary: This option is dead code.

Reviewed By: ilya-klyuchnikov

Differential Revision: D62180616

fbshipit-source-id: d9ad8c0f95f3ed8f6ae0ecfaf0494d618f33c5b3
  • Loading branch information
VLanvin authored and facebook-github-bot committed Sep 4, 2024
1 parent 4d86d45 commit c96bfcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/eqwalizer/src/ast/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn expanded_stub(
module: ModuleName,
) -> Result<Arc<ModuleStub>, Error> {
let stub = db.converted_stub(project_id, module.clone())?;
let mut expander = StubExpander::new(db, project_id, true, module.as_str().into(), &stub);
let mut expander = StubExpander::new(db, project_id, module.as_str().into(), &stub);
expander
.expand(stub.to_vec())
.map(|()| Arc::new(expander.stub))
Expand Down
7 changes: 2 additions & 5 deletions crates/eqwalizer/src/ast/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ use crate::ast;

struct Expander<'d> {
module: SmolStr,
approximate: bool,
project_id: ProjectId,
db: &'d dyn EqwalizerASTDatabase,
}
Expand Down Expand Up @@ -342,7 +341,7 @@ impl Expander<'_> {
tys: self.expand_types(ty.tys)?,
})),
ExtType::MapExtType(ty) => {
if self.approximate && ty.props.iter().any(|prop| !prop.is_ok()) {
if ty.props.iter().any(|prop| !prop.is_ok()) {
Ok(ExtType::MapExtType(MapExtType {
location: ty.location.clone(),
props: vec![ExtProp::OptExtProp(OptExtProp {
Expand Down Expand Up @@ -480,7 +479,7 @@ impl Expander<'_> {
tys: self.expand_all_constraints(ty.tys, sub, stack)?,
})),
ExtType::MapExtType(ty) => {
if self.approximate && ty.props.iter().any(|prop| !prop.is_ok()) {
if ty.props.iter().any(|prop| !prop.is_ok()) {
Ok(ExtType::MapExtType(MapExtType {
location: ty.location.clone(),
props: vec![ExtProp::OptExtProp(OptExtProp {
Expand Down Expand Up @@ -599,13 +598,11 @@ impl StubExpander<'_> {
pub fn new<'d>(
db: &'d dyn EqwalizerASTDatabase,
project_id: ProjectId,
approximate: bool,
module: SmolStr,
ast: &AST,
) -> StubExpander<'d> {
let expander = Expander {
module: module.clone(),
approximate,
db,
project_id,
};
Expand Down

0 comments on commit c96bfcb

Please sign in to comment.