compiler: fix panic on import errors
I think this is a problem in the loader package - it doesn't seem to return errors for missing packages.
Этот коммит содержится в:
родитель
8a468786df
коммит
9df04a2170
1 изменённых файлов: 1 добавлений и 9 удалений
|
@ -167,7 +167,6 @@ func (c *Compiler) Parse(mainPath string) error {
|
||||||
BuildTags: append([]string{"tgo"}, c.BuildTags...),
|
BuildTags: append([]string{"tgo"}, c.BuildTags...),
|
||||||
},
|
},
|
||||||
ParserMode: parser.ParseComments,
|
ParserMode: parser.ParseComments,
|
||||||
AllowErrors: true,
|
|
||||||
}
|
}
|
||||||
config.Import("runtime")
|
config.Import("runtime")
|
||||||
config.Import(mainPath)
|
config.Import(mainPath)
|
||||||
|
@ -176,13 +175,6 @@ func (c *Compiler) Parse(mainPath string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: pick the error of the first package, not a random package
|
|
||||||
for _, pkgInfo := range lprogram.AllPackages {
|
|
||||||
if len(pkgInfo.Errors) != 0 {
|
|
||||||
return pkgInfo.Errors[0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
c.ir = ir.NewProgram(lprogram, mainPath)
|
c.ir = ir.NewProgram(lprogram, mainPath)
|
||||||
|
|
||||||
// Make a list of packages in import order.
|
// Make a list of packages in import order.
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче