merge master and resolve conflicts

This commit is contained in:
gluaxspeed 2021-09-10 06:53:47 -07:00
commit c1e9c72d2a
4 changed files with 16 additions and 16 deletions

4
Cargo.lock generated
View File

@ -2499,9 +2499,9 @@ dependencies = [
[[package]] [[package]]
name = "sha2" name = "sha2"
version = "0.9.6" version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9204c41a1597a8c5af23c82d1c921cb01ec0a4c59e07a9c7306062829a3903f3" checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
dependencies = [ dependencies = [
"block-buffer 0.9.0", "block-buffer 0.9.0",
"cfg-if 1.0.0", "cfg-if 1.0.0",

View File

@ -470,16 +470,16 @@ impl Canonicalizer {
fn canonicalize_function_input(&mut self, input: &FunctionInput) -> FunctionInput { fn canonicalize_function_input(&mut self, input: &FunctionInput) -> FunctionInput {
if let FunctionInput::Variable(variable) = input { if let FunctionInput::Variable(variable) = input {
if variable.type_.is_self() { let type_ = self.canonicalize_self_type(Some(&variable.type_)).unwrap();
return FunctionInput::Variable(FunctionInputVariable { return FunctionInput::Variable(FunctionInputVariable {
identifier: variable.identifier.clone(), identifier: variable.identifier.clone(),
const_: variable.const_, const_: variable.const_,
mutable: variable.mutable, mutable: variable.mutable,
type_: Type::Identifier(self.circuit_name.as_ref().unwrap().clone()), type_,
span: variable.span.clone(), span: variable.span.clone(),
}); });
} }
}
input.clone() input.clone()
} }

View File

@ -20,7 +20,7 @@ circuit Foo {
y[Self {x: 0}.x] += 2; y[Self {x: 0}.x] += 2;
} }
function func() { function func(a: [Self; 3], y: (Self)) {
const x: Self = Foo {x: Self {x: 1}.x}; const x: Self = Foo {x: Self {x: 1}.x};
} }

View File

@ -16,7 +16,7 @@ outputs:
r0: r0:
type: bool type: bool
value: "true" value: "true"
initial_ast: d8ff1c8c84bc93bbd4e712dde7eb3c9dbe433199f5902b6dc3329cf3ca607811 initial_ast: ec52d3b3e69bef6d104f2dcfa9e713a728d7b0e15439c9da3b521b6cbfe719d4
imports_resolved_ast: aee1ae257d5270f8a310af0266b7a4226fdc23498e9aedf35633710fa31599a3 imports_resolved_ast: add95914a89cb2686db8c906b94acca8e7dfcad9db26ad83a75c327e0eb19ca0
canonicalized_ast: b5525cdb08607392c38fd870e9719b34c3f960a3911e3a2ef50b7ae55f777c9f canonicalized_ast: 21d2efd19f936682f161dcdf804c30d745f47201a5702de7ceecf81544291561
type_inferenced_ast: 6e03e1d79176a685668c1a34cec906f22cf7a90a128de24fbc2bcc8aad3598d4 type_inferenced_ast: 0814bcdc1e7422f32192c44a7b4a12b0d4b9f2e5ef612521c73800fc3e27dfcb