From c55ef52828035ff35baf623bfb98d65eec6a1c34 Mon Sep 17 00:00:00 2001 From: StunxFS Date: Sun, 28 Jan 2024 10:25:25 -0400 Subject: [PATCH] fix more warns --- cmd/src/tools/cmd_new.ri | 4 +--- lib/rivet/src/ast/Expr.ri | 4 ++-- lib/rivet/src/checker/mod.ri | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/src/tools/cmd_new.ri b/cmd/src/tools/cmd_new.ri index 34f396138..2f396b0b1 100644 --- a/cmd/src/tools/cmd_new.ri +++ b/cmd/src/tools/cmd_new.ri @@ -54,7 +54,7 @@ pub func cmd_new(args: [:]string, is_init: bool) -> ! { utils.error(err_fp.to_string()) }; - mut project := Project(); + mut project := Project(version: semver.Version.build(0, 1, 0)); if is_init { project.name = Path.base_name(process.get_cwd()!); } else { @@ -72,8 +72,6 @@ pub func cmd_new(args: [:]string, is_init: bool) -> ! { project.version = semver.Version.from_string(version) catch |err| { utils.error(err.to_string()) }; - } else { - project.version = semver.Version.build(0, 1, 0); } if license := readln("License (optional):") { project.license = license; diff --git a/lib/rivet/src/ast/Expr.ri b/lib/rivet/src/ast/Expr.ri index 25369d886..18e185ac2 100644 --- a/lib/rivet/src/ast/Expr.ri +++ b/lib/rivet/src/ast/Expr.ri @@ -53,7 +53,7 @@ pub enum Expr < traits.Stringable { pos: token.Pos; mut found: bool; mut sym: ^mut TypeSym := invalid_type_sym; - mut obj: ^mut Var; + mut obj: ^mut Var := ^mut Var(); mut type: ^mut Type; }, NoneLiteral { @@ -176,7 +176,7 @@ pub enum Expr < traits.Stringable { mut err_handler: CallErrorHandler; pos: token.Pos; mut type: ^mut Type; - mut func_: ^mut Func; + mut func_: ^mut Func := ^mut Func(); mut is_closure: bool; mut is_constructor: bool; diff --git a/lib/rivet/src/checker/mod.ri b/lib/rivet/src/checker/mod.ri index e8e6a5573..06a4dc486 100644 --- a/lib/rivet/src/checker/mod.ri +++ b/lib/rivet/src/checker/mod.ri @@ -22,7 +22,7 @@ pub struct Checker { mut source_file: ^mut ast.SourceFile; sym: ^mut ast.Sym := ast.InvalidSym(); - mut cur_func: ^mut ast.Func; + mut cur_func: ^mut ast.Func := ^mut ast.Func(); mut inside_extern: bool; mut inside_test: bool;