Skip to content

Commit a2cbd03

Browse files
committed
Finished adding ability to specify trait implementations needing to directly name the implementation parameter
1 parent b7800f4 commit a2cbd03

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: src/asg/func.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::{asg::*, name::ResolvedName, source_files::Source, tag::Tag};
2+
use indexmap::IndexMap;
23
use std::{collections::HashSet, fmt::Display};
34

45
#[derive(Clone, Debug)]
@@ -48,7 +49,7 @@ impl<'a> CurrentConstraints {
4849

4950
#[derive(Clone, Debug)]
5051
pub struct ImplParams {
51-
pub params: HashMap<String, GenericTraitRef>,
52+
pub params: IndexMap<String, GenericTraitRef>,
5253
}
5354

5455
#[derive(Clone, Debug)]

Diff for: src/resolve/expr/call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub fn call_callee(
9494
.iter()
9595
.filter(|(param_name, param)| {
9696
param.trait_ref == arg_concrete_trait.trait_ref
97-
&& used_names.contains(*param_name)
97+
&& !used_names.contains(*param_name)
9898
})
9999
.map(|(param_name, _)| param_name)
100100
.next()

Diff for: src/resolve/func_head.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
tag::Tag,
1414
workspace::fs::FsNodeId,
1515
};
16-
use std::collections::HashMap;
16+
use indexmap::IndexMap;
1717

1818
pub fn create_func_heads<'a>(
1919
ctx: &mut ResolveCtx,
@@ -102,7 +102,7 @@ pub fn create_func_head<'a>(
102102
.unwrap_or_default();
103103

104104
let impl_params = {
105-
let mut params = HashMap::default();
105+
let mut params = IndexMap::default();
106106

107107
for given in &head.givens {
108108
let trait_ty = type_ctx.resolve(&given.ty)?;

0 commit comments

Comments
 (0)