This commit is contained in:
Бондарев Иван 2018-12-09 17:32:15 +01:00
parent d3bc8a42ac
commit 903ed82273
2 changed files with 20 additions and 1 deletions

View file

@ -1101,7 +1101,21 @@ namespace PascalABCCompiler.NETGenerator
//(ssyy) TODO: подумать, в каком порядке создавать типы
for (int i = 0; i < types.Count; i++)
if (types[i].IsInterface)
types[i].CreateType();
try
{
types[i].CreateType();
}
catch(TypeLoadException ex)
{
if (ex.Message.Contains("рекурсивное") || ex.Message.Contains("recursive") || ex.Message.Contains("rekursiv"))
{
SemanticTree.ICommonTypeNode ctn = helper.GetTypeNodeByTypeBuilder(types[i]);
if (ctn != null)
throw new PascalABCCompiler.Errors.CommonCompilerError(ex.Message, ctn.Location.document.file_name, ctn.Location.begin_line_num, ctn.Location.begin_column_num);
}
}
for (int i = 0; i < enums.Count; i++)
enums[i].CreateType();
for (int i = 0; i < value_types.Count; i++)

View file

@ -0,0 +1,5 @@
type
I0<T> = interface end;
I1<T> = interface(I0<I1<I0<T>>>) end;
begin end.