Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects

This commit is contained in:
Folkert 2022-10-30 15:57:07 +01:00
commit dbd0d30893
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
98 changed files with 4649 additions and 1433 deletions

View file

@ -86,7 +86,7 @@ pub enum RecordField {
pub struct AbilityMember {
pub name: String,
pub type_annotation: TypeAnnotation,
pub able_variables: Vec<(String, TypeAnnotation)>,
pub able_variables: Vec<(String, Vec<TypeAnnotation>)>,
pub docs: Option<String>,
}
@ -387,17 +387,20 @@ fn type_to_docs(in_func_type_ann: bool, type_annotation: ast::TypeAnnotation) ->
fn ability_member_type_to_docs(
type_annotation: ast::TypeAnnotation,
) -> (TypeAnnotation, Vec<(String, TypeAnnotation)>) {
) -> (TypeAnnotation, Vec<(String, Vec<TypeAnnotation>)>) {
match type_annotation {
ast::TypeAnnotation::Where(ta, has_clauses) => {
let ta = type_to_docs(false, ta.value);
let has_clauses = has_clauses
.iter()
.map(|hc| {
let ast::HasClause { var, ability } = hc.value;
let ast::HasClause { var, abilities } = hc.value;
(
var.value.extract_spaces().item.to_string(),
type_to_docs(false, ability.value),
abilities
.iter()
.map(|ability| type_to_docs(false, ability.value))
.collect(),
)
})
.collect();

View file

@ -4471,7 +4471,7 @@ fn run_solve_solve(
.values()
.any(|resolved_impl| match resolved_impl {
ResolvedImpl::Impl(specialization) => specialization.symbol == sym,
ResolvedImpl::Derived | ResolvedImpl::Error => false,
ResolvedImpl::Error => false,
})
};