From 877674230a200b7137b42a0b2e134e44afef7a5d Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Mon, 28 Mar 2022 07:47:05 -0700 Subject: [PATCH] remove aliases and gcs --- compiler/ast/src/aliases/alias.rs | 42 ------------------- compiler/ast/src/aliases/mod.rs | 18 -------- compiler/ast/src/lib.rs | 3 -- compiler/ast/src/program.rs | 14 +------ .../src/reducer/reconstructing_director.rs | 21 +--------- .../ast/src/reducer/reconstructing_reducer.rs | 4 -- compiler/parser/src/parser/file.rs | 25 ----------- .../parser/expression/literal/comment.leo.out | 2 - .../functions/bounded_recursion.leo.out | 2 - .../parser/functions/const_function.leo.out | 2 - .../functions/const_function_fail.leo.out | 2 +- .../parser/functions/const_param.leo.out | 2 - .../parser/parser/functions/empty.leo.out | 2 - .../parser/parser/functions/empty2.leo.out | 2 - .../functions/infinite_recursion.leo.out | 2 - .../parser/functions/param_tuple.leo.out | 2 - .../parser/parser/functions/params.leo.out | 2 - .../parser/functions/params_return.leo.out | 2 - .../parser/parser/functions/return.leo.out | 2 - .../parser/functions/return_tuple.leo.out | 2 - .../parser/serialize/one_plus_one.leo.out | 2 - tests/parser/statement/alias.leo | 10 ----- tests/parser/statement/global_const.leo | 14 ------- 23 files changed, 3 insertions(+), 176 deletions(-) delete mode 100644 compiler/ast/src/aliases/alias.rs delete mode 100644 compiler/ast/src/aliases/mod.rs delete mode 100644 tests/parser/statement/alias.leo delete mode 100644 tests/parser/statement/global_const.leo diff --git a/compiler/ast/src/aliases/alias.rs b/compiler/ast/src/aliases/alias.rs deleted file mode 100644 index 17659ae657..0000000000 --- a/compiler/ast/src/aliases/alias.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{Identifier, Type}; -use leo_span::Span; - -use std::fmt; - -use serde::{Deserialize, Serialize}; - -/// A type alias `type name = represents;`. -/// -/// That is, `name` will become another name for `represents`. -/// This does not create a new type, that is, `name` is the same type as `represents`. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Alias { - /// The new name for `represents`. - pub name: Identifier, - /// A span for the entire `type name = represents;`. - pub span: Span, - /// The type that `name` will evaluate and is equal to. - pub represents: Type, -} - -impl fmt::Display for Alias { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{} : {}", self.name.name, self.represents) - } -} diff --git a/compiler/ast/src/aliases/mod.rs b/compiler/ast/src/aliases/mod.rs deleted file mode 100644 index 393212003a..0000000000 --- a/compiler/ast/src/aliases/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod alias; -pub use self::alias::*; diff --git a/compiler/ast/src/lib.rs b/compiler/ast/src/lib.rs index b9b7b57f5d..be4eb84c78 100644 --- a/compiler/ast/src/lib.rs +++ b/compiler/ast/src/lib.rs @@ -25,9 +25,6 @@ pub mod accesses; pub use self::accesses::*; -pub mod aliases; -pub use self::aliases::*; - pub mod chars; pub use self::chars::*; diff --git a/compiler/ast/src/program.rs b/compiler/ast/src/program.rs index 89f8beef5a..02dd7ad60d 100644 --- a/compiler/ast/src/program.rs +++ b/compiler/ast/src/program.rs @@ -17,7 +17,7 @@ //! A Leo program consists of import, circuit, and function definitions. //! Each defined type consists of ast statements and expressions. -use crate::{Alias, DefinitionStatement, Function, FunctionInput, Identifier}; +use crate::{Function, FunctionInput, Identifier}; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; @@ -32,11 +32,6 @@ pub struct Program { /// Expected main function inputs. /// Empty after parsing. pub expected_input: Vec, - /// A map from alias names to type aliases. - pub aliases: IndexMap, - /// A map from constant names to their definitions. - #[serde(with = "crate::common::global_consts_json")] - pub global_consts: IndexMap, DefinitionStatement>, /// A map from function names to their definitions. pub functions: IndexMap, } @@ -49,11 +44,6 @@ impl AsRef for Program { impl fmt::Display for Program { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - for (_, alias) in self.aliases.iter() { - alias.fmt(f)?; - writeln!(f,)?; - } - writeln!(f,)?; for (_, function) in self.functions.iter() { function.fmt(f)?; writeln!(f,)?; @@ -68,8 +58,6 @@ impl Program { Self { name, expected_input: vec![], - aliases: IndexMap::new(), - global_consts: IndexMap::new(), functions: IndexMap::new(), } } diff --git a/compiler/ast/src/reducer/reconstructing_director.rs b/compiler/ast/src/reducer/reconstructing_director.rs index cf03acc0a5..e4a1295bbe 100644 --- a/compiler/ast/src/reducer/reconstructing_director.rs +++ b/compiler/ast/src/reducer/reconstructing_director.rs @@ -319,31 +319,12 @@ impl ReconstructingDirector { inputs.push(self.reduce_function_input(input)?); } - let mut aliases = IndexMap::new(); - for (name, alias) in program.aliases.iter() { - let represents = self.reduce_type(&alias.represents, &alias.name.span)?; - aliases.insert( - name.clone(), - Alias { - name: alias.name.clone(), - span: alias.span.clone(), - represents, - }, - ); - } - let mut functions = IndexMap::new(); for (name, function) in program.functions.iter() { functions.insert(name.clone(), self.reduce_function(function)?); } - let mut global_consts = IndexMap::new(); - for (name, definition) in program.global_consts.iter() { - global_consts.insert(name.clone(), self.reduce_definition(definition)?); - } - - self.reducer - .reduce_program(program, inputs, aliases, functions, global_consts) + self.reducer.reduce_program(program, inputs, functions) } pub fn reduce_function_input_variable( diff --git a/compiler/ast/src/reducer/reconstructing_reducer.rs b/compiler/ast/src/reducer/reconstructing_reducer.rs index da611dd039..855d98b74d 100644 --- a/compiler/ast/src/reducer/reconstructing_reducer.rs +++ b/compiler/ast/src/reducer/reconstructing_reducer.rs @@ -291,16 +291,12 @@ pub trait ReconstructingReducer { &mut self, program: &Program, expected_input: Vec, - aliases: IndexMap, functions: IndexMap, - global_consts: IndexMap, DefinitionStatement>, ) -> Result { Ok(Program { name: program.name.clone(), expected_input, - aliases, functions, - global_consts, }) } diff --git a/compiler/parser/src/parser/file.rs b/compiler/parser/src/parser/file.rs index 38186508bd..207711b1d5 100644 --- a/compiler/parser/src/parser/file.rs +++ b/compiler/parser/src/parser/file.rs @@ -24,9 +24,7 @@ impl ParserContext<'_> { /// Returns a [`Program`] AST if all tokens can be consumed and represent a valid Leo program. /// pub fn parse_program(&mut self) -> Result { - let mut aliases = IndexMap::new(); let mut functions = IndexMap::new(); - let mut global_consts = IndexMap::new(); while self.has_next() { let token = self.peek()?; @@ -37,27 +35,17 @@ impl ParserContext<'_> { let (id, function) = self.parse_function_declaration()?; functions.insert(id, function); } - Token::Const => { - let (name, global_const) = self.parse_global_const_declaration()?; - global_consts.insert(name, global_const); - } Token::Function => { let (id, function) = self.parse_function_declaration()?; functions.insert(id, function); } - Token::Type => { - let (name, alias) = self.parse_type_alias()?; - aliases.insert(name, alias); - } _ => return Err(Self::unexpected_item(token).into()), } } Ok(Program { name: String::new(), expected_input: Vec::new(), - aliases, functions, - global_consts, }) } @@ -147,17 +135,4 @@ impl ParserContext<'_> { Ok((variable_names, statement)) } - - /// - /// Returns a [`(String, Alias)`] AST node if the next tokens represent a type alias declaration. - /// - pub fn parse_type_alias(&mut self) -> Result<(Identifier, Alias)> { - let start = self.expect(Token::Type)?; - let name = self.expect_ident()?; - self.expect(Token::Assign)?; - let (represents, _) = self.parse_type()?; - let span = start + self.expect(Token::Semicolon)?; - - Ok((name.clone(), Alias { represents, span, name })) - } } diff --git a/tests/expectations/parser/parser/expression/literal/comment.leo.out b/tests/expectations/parser/parser/expression/literal/comment.leo.out index 53a1d748cb..bc50235bda 100644 --- a/tests/expectations/parser/parser/expression/literal/comment.leo.out +++ b/tests/expectations/parser/parser/expression/literal/comment.leo.out @@ -4,6 +4,4 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: {} diff --git a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out index d6f231c45e..c5daae1256 100644 --- a/tests/expectations/parser/parser/functions/bounded_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/bounded_recursion.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const y: u32) {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/const_function.leo.out b/tests/expectations/parser/parser/functions/const_function.leo.out index de57c5e98a..279b8694e6 100644 --- a/tests/expectations/parser/parser/functions/const_function.leo.out +++ b/tests/expectations/parser/parser/functions/const_function.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const function x() {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const function x() {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/const_function_fail.leo.out b/tests/expectations/parser/parser/functions/const_function_fail.leo.out index 72572b4700..c6df75c98d 100644 --- a/tests/expectations/parser/parser/functions/const_function_fail.leo.out +++ b/tests/expectations/parser/parser/functions/const_function_fail.leo.out @@ -2,4 +2,4 @@ namespace: Parse expectation: Fail outputs: - - "Error [EPAR0370003]: unexpected EOF\n --> test:3:1\n |\n 3 | const\n | ^^^^^" + - "Error [EPAR0370005]: expected 'function', 'test' -- got 'const'\n --> test:3:1\n |\n 3 | const\n | ^^^^^" diff --git a/tests/expectations/parser/parser/functions/const_param.leo.out b/tests/expectations/parser/parser/functions/const_param.leo.out index 739dfcb9cd..7e1e9b437a 100644 --- a/tests/expectations/parser/parser/functions/const_param.leo.out +++ b/tests/expectations/parser/parser/functions/const_param.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, const y: i32) {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/empty.leo.out b/tests/expectations/parser/parser/functions/empty.leo.out index 3527b26a9a..090289cdca 100644 --- a/tests/expectations/parser/parser/functions/empty.leo.out +++ b/tests/expectations/parser/parser/functions/empty.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/empty2.leo.out b/tests/expectations/parser/parser/functions/empty2.leo.out index 1cce2c759e..3de9314352 100644 --- a/tests/expectations/parser/parser/functions/empty2.leo.out +++ b/tests/expectations/parser/parser/functions/empty2.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out index 5dd8732ba8..196af95639 100644 --- a/tests/expectations/parser/parser/functions/infinite_recursion.leo.out +++ b/tests/expectations/parser/parser/functions/infinite_recursion.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function inf() {\\\"}\"}": identifier: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function inf() {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/param_tuple.leo.out b/tests/expectations/parser/parser/functions/param_tuple.leo.out index 43978a9ea8..d9952c25e2 100644 --- a/tests/expectations/parser/parser/functions/param_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/param_tuple.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: (u32, i32)) {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/params.leo.out b/tests/expectations/parser/parser/functions/params.leo.out index 5b89a44024..908451d00c 100644 --- a/tests/expectations/parser/parser/functions/params.leo.out +++ b/tests/expectations/parser/parser/functions/params.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/params_return.leo.out b/tests/expectations/parser/parser/functions/params_return.leo.out index 58598e9061..afda5e6cfc 100644 --- a/tests/expectations/parser/parser/functions/params_return.leo.out +++ b/tests/expectations/parser/parser/functions/params_return.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(x: u32, y: i32) -> u32 {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/return.leo.out b/tests/expectations/parser/parser/functions/return.leo.out index f13226cd96..de005bdb0e 100644 --- a/tests/expectations/parser/parser/functions/return.leo.out +++ b/tests/expectations/parser/parser/functions/return.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> u32 {\\\"}\"}" diff --git a/tests/expectations/parser/parser/functions/return_tuple.leo.out b/tests/expectations/parser/parser/functions/return_tuple.leo.out index 9d36d866f8..37cef6e6e3 100644 --- a/tests/expectations/parser/parser/functions/return_tuple.leo.out +++ b/tests/expectations/parser/parser/functions/return_tuple.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}": identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() -> (u32, u32) {\\\"}\"}" diff --git a/tests/expectations/parser/parser/serialize/one_plus_one.leo.out b/tests/expectations/parser/parser/serialize/one_plus_one.leo.out index af78423917..7812751117 100644 --- a/tests/expectations/parser/parser/serialize/one_plus_one.leo.out +++ b/tests/expectations/parser/parser/serialize/one_plus_one.leo.out @@ -4,8 +4,6 @@ expectation: Pass outputs: - name: "" expected_input: [] - aliases: {} - global_consts: {} functions: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() -> u8 {\\\"}\"}": identifier: "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main() -> u8 {\\\"}\"}" diff --git a/tests/parser/statement/alias.leo b/tests/parser/statement/alias.leo deleted file mode 100644 index 5c395301f9..0000000000 --- a/tests/parser/statement/alias.leo +++ /dev/null @@ -1,10 +0,0 @@ -/* -namespace: Parse -expectation: Pass -*/ - -type a = u32; - -type b = string; - -type c = a; diff --git a/tests/parser/statement/global_const.leo b/tests/parser/statement/global_const.leo deleted file mode 100644 index bb51ae8aa2..0000000000 --- a/tests/parser/statement/global_const.leo +++ /dev/null @@ -1,14 +0,0 @@ -/* -namespace: Parse -expectation: Pass -*/ - -const x: u32 = 1u32; - -const f: u32 = x; - -const x: i32 = 1i32; - -const y: string = "hello world"; - -const x: char = 'b';