diff --git a/lib/rivet/src/ast/Scope.ri b/lib/rivet/src/ast/Scope.ri index e59d14bf0..343ea83fd 100644 --- a/lib/rivet/src/ast/Scope.ri +++ b/lib/rivet/src/ast/Scope.ri @@ -28,7 +28,7 @@ pub struct Scope { pub func add_or_get(mut self, sym: Sym) -> !Sym { if old_sym := self.find(sym.name) { - if sym is TypeSym as type_sym and old_sym is TypeSym as mut old_type_sym { + if sym is TypeSym(type_sym) and old_sym is TypeSym(mut old_type_sym) { if old_type_sym.update(type_sym)! { return old_sym; } @@ -117,7 +117,7 @@ pub struct Scope { pub func update_type(self, name: string, type: Type) { if sym := self.lookup(name) { - if sym is Var as var_info { + if sym is Var(var_info) { var_info.type = type; } } @@ -125,7 +125,7 @@ pub struct Scope { pub func update_is_hidden_ref(self, name: string, is_hidden_ref: bool) { if sym := self.lookup(name) { - if sym is Var as var_info { + if sym is Var(var_info) { var_info.is_hidden_ref = is_hidden_ref; } } @@ -133,7 +133,7 @@ pub struct Scope { pub func update_is_used(self, name: string, is_used: bool) { if sym := self.lookup(name) { - if sym is Var as var_info { + if sym is Var(var_info) { var_info.is_used = is_used; } } diff --git a/lib/rivet/src/ast/Sym.ri b/lib/rivet/src/ast/Sym.ri index 3ecf23ea0..177f4475b 100644 --- a/lib/rivet/src/ast/Sym.ri +++ b/lib/rivet/src/ast/Sym.ri @@ -72,7 +72,7 @@ pub trait Sym { func module(self) -> ?Module { mut p := self; while { - if p is Module as mod { + if p is Module(mod) { return mod; } else if p_ := p.parent { p = p_; diff --git a/lib/rivet/src/ast/TypeSym.ri b/lib/rivet/src/ast/TypeSym.ri index 94711d798..8221ec1c5 100644 --- a/lib/rivet/src/ast/TypeSym.ri +++ b/lib/rivet/src/ast/TypeSym.ri @@ -93,12 +93,12 @@ pub struct TypeSym < Sym { #[inline] pub func find_func(self, name: string) -> ?Func { - return if sym := self.scope.find(name); sym is Func as func_ { + return if sym := self.scope.find(name); sym is Func(func_) { if self.info !is .Trait and !func_.has_body { return none; } func_ - } else if sym := self.find_in_base(name); sym is Func as func_ { + } else if sym := self.find_in_base(name); sym is Func(func_) { if self.info !is .Trait and !func_.has_body { return none; } diff --git a/tests/valid/src/traits.ri b/tests/valid/src/traits.ri index 3a6184ae9..1df4a71c9 100644 --- a/tests/valid/src/traits.ri +++ b/tests/valid/src/traits.ri @@ -84,5 +84,5 @@ struct IntegerStruct { test "traits with `default_value` attribute" { is_ := IntegerStruct(); - @assert(is_.i is IntegerValue as int_v and int_v.int == 5); + @assert(is_.i is IntegerValue(int_v) and int_v.int == 5); }