mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast/checker: cast no longer needed & use auto deref
This commit is contained in:
parent
8488f7d82b
commit
2a40665919
@ -60,8 +60,7 @@ pub fn (s &Scope) is_known(name string) bool {
|
||||
|
||||
pub fn (s &Scope) find_var(name string) ?&Var {
|
||||
if obj := s.find(name) {
|
||||
v := ScopeObject(obj)
|
||||
match v {
|
||||
match obj {
|
||||
Var {
|
||||
return it
|
||||
}
|
||||
@ -73,8 +72,7 @@ pub fn (s &Scope) find_var(name string) ?&Var {
|
||||
|
||||
pub fn (s &Scope) find_const(name string) ?&ConstField {
|
||||
if obj := s.find(name) {
|
||||
cf := ScopeObject(obj)
|
||||
match cf {
|
||||
match obj {
|
||||
ConstField {
|
||||
return it
|
||||
}
|
||||
|
@ -1331,7 +1331,7 @@ fn const_int_value(cfield ast.ConstField) ?int {
|
||||
|
||||
fn is_const_integer(cfield ast.ConstField) ?ast.IntegerLiteral {
|
||||
match cfield.expr {
|
||||
ast.IntegerLiteral { return *it }
|
||||
ast.IntegerLiteral { return it }
|
||||
else {}
|
||||
}
|
||||
return none
|
||||
|
Loading…
Reference in New Issue
Block a user