Do not add default and closure types in 'add explicit type' assist

This commit is contained in:
Kirill Bulatov 2020-04-21 22:56:11 +03:00
parent 7ab28cacbb
commit ce06a6b422
2 changed files with 47 additions and 5 deletions

View file

@ -1132,6 +1132,10 @@ impl Type {
Some(self.ty.value.as_callable()?.0)
}
pub fn is_closure(&self) -> bool {
matches!(&self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Closure { .. }, .. }))
}
pub fn contains_unknown(&self) -> bool {
return go(&self.ty.value);