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

compiler: add hint to use references for dependant struct fields

This commit is contained in:
joe-conigliaro 2019-10-24 19:18:50 +11:00 committed by Alexander Medvednikov
parent 1ce2acb4ef
commit 71d965b6a2

View File

@ -363,6 +363,7 @@ fn sort_structs(types []Type) []Type {
if !dep_graph_sorted.acyclic { if !dep_graph_sorted.acyclic {
verror('cgen.sort_structs(): the following structs form a dependancy cycle:\n' + verror('cgen.sort_structs(): the following structs form a dependancy cycle:\n' +
dep_graph_sorted.display_cycles() + dep_graph_sorted.display_cycles() +
'\nyou can solve this by making one or both of the dependant struct fields references, eg: field &MyStruct' +
'\nif you feel this is an error, please create a new issue here: https://github.com/vlang/v/issues and tag @joe-conigliaro') '\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 // sort types