tsz-checker 0.1.9

TypeScript type checker for the tsz compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use tsz_solver::TypeId;
use tsz_solver::type_queries::{EvaluationNeeded, classify_for_evaluation};

pub(crate) fn should_evaluate_contextual_declared_type(
    db: &dyn tsz_solver::TypeDatabase,
    declared_type: TypeId,
) -> bool {
    matches!(
        classify_for_evaluation(db, declared_type),
        EvaluationNeeded::Conditional { .. }
            | EvaluationNeeded::Mapped { .. }
            | EvaluationNeeded::IndexAccess { .. }
    )
}