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

show struct dependency cycles in error & update module cycle error (#2517)

This commit is contained in:
joe-conigliaro
2019-10-24 15:53:39 +11:00
committed by GitHub
parent f14425ec18
commit baf49b2523
3 changed files with 30 additions and 23 deletions

View File

@@ -361,7 +361,9 @@ fn sort_structs(types []Type) []Type {
// sort graph
dep_graph_sorted := dep_graph.resolve()
if !dep_graph_sorted.acyclic {
verror('error: cgen.sort_structs() DGNAC.\nplease create a new issue here: https://github.com/vlang/v/issues and tag @joe-conigliaro')
verror('cgen.sort_structs(): the following structs form a dependancy cycle:\n' +
dep_graph_sorted.display_cycles() +
'\nif you feel this is an error, please create a new issue here: https://github.com/vlang/v/issues and tag @joe-conigliaro')
}
// sort types
mut types_sorted := []Type