mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: disallow statements after a return, branch check $if, $else, switch, and loops correctly
This commit is contained in:
committed by
Alexander Medvednikov
parent
58b52aa9fb
commit
1864e92ff4
@@ -739,8 +739,7 @@ fn (t mut Table) fn_gen_types(fn_name string) []string {
|
||||
return f.types
|
||||
}
|
||||
}
|
||||
panic('function $fn_name not found') // TODO panic or return []?
|
||||
return []string // TODO remove return
|
||||
panic('function $fn_name not found')
|
||||
}
|
||||
|
||||
// `foo<Bar>()`
|
||||
@@ -830,7 +829,6 @@ fn (fit mut FileImportTable) register_import(mod string) {
|
||||
fn (fit mut FileImportTable) register_alias(alias string, mod string) {
|
||||
if alias in fit.imports {
|
||||
panic('cannot import $mod as $alias: import name $alias already in use in "${fit.file_path}".')
|
||||
return
|
||||
}
|
||||
if mod.contains('.internal.') {
|
||||
mod_parts := mod.split('.')
|
||||
|
||||
Reference in New Issue
Block a user