1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker/parser: allow for fixed array with sizes defined with a const

This commit is contained in:
Delyan Angelov
2020-04-10 22:00:54 +03:00
parent 514d989a27
commit 217e6f3b8e
9 changed files with 99 additions and 26 deletions

View File

@ -56,7 +56,8 @@ pub fn (s &Scope) is_known(name string) bool {
pub fn (s &Scope) find_var(name string) ?Var {
if obj := s.find(name) {
match obj {
v := ScopeObject(obj)
match v {
Var {
return *it
}
@ -68,7 +69,8 @@ pub fn (s &Scope) find_var(name string) ?Var {
pub fn (s &Scope) find_const(name string) ?ConstField {
if obj := s.find(name) {
match obj {
cf := ScopeObject(obj)
match cf {
ConstField {
return *it
}