This commit is contained in:
parent
bc726bbfc0
commit
5548def725
|
|
@ -1,4 +1,5 @@
|
|||
function f(i: integer): string;
|
||||
//!GetType не объявлен в типе function(i: integer): string
|
||||
function f(i: integer): string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
function f(i: integer): integer;
|
||||
//!Ожидался порядковый или строковый тип
|
||||
function f(i: integer): integer;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
procedure p1<T>(o: T);
|
||||
//!Невозможно инстанцировать, так как тип IEnumerable<char> не наследован от string
|
||||
procedure p1<T>(o: T);
|
||||
where T: string;
|
||||
begin
|
||||
o.Length.Println;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
unit err0429;
|
||||
//!Класс t1 абстрактный и не может иметь атрибут sealed, потому что метод p1 не реализован
|
||||
unit err0429;
|
||||
type
|
||||
t0 = partial abstract class
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
unit err0430;
|
||||
//!Класс t1 абстрактный и не может иметь атрибут sealed, потому что метод p1 не реализован
|
||||
unit err0430;
|
||||
|
||||
interface
|
||||
type
|
||||
|
|
|
|||
10
TestSuite/errors/err0431.pas
Normal file
10
TestSuite/errors/err0431.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
//!Неизвестное имя 't1'
|
||||
unit err0431;
|
||||
|
||||
uses err0432;
|
||||
|
||||
type
|
||||
t3 = class(err0432.t1)
|
||||
end;
|
||||
|
||||
end.
|
||||
7
TestSuite/errors/err0432.pas
Normal file
7
TestSuite/errors/err0432.pas
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//exclude
|
||||
{$savepcu false}
|
||||
unit err0432;
|
||||
|
||||
uses err0433;
|
||||
|
||||
end.
|
||||
8
TestSuite/errors/err0433.pas
Normal file
8
TestSuite/errors/err0433.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//exclude
|
||||
{$savepcu false}
|
||||
unit err0433;
|
||||
|
||||
type
|
||||
t1 = class end;
|
||||
|
||||
end.
|
||||
|
|
@ -871,7 +871,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
int num = names.names.Count - 1;
|
||||
if (di is namespace_node)
|
||||
{
|
||||
si = (di as namespace_node).find(names.names[num].name);
|
||||
si = (di as namespace_node).findOnlyInNamespace(names.names[num].name);
|
||||
if (si == null && throw_error)
|
||||
AddError(new UndefinedNameReference(names.names[num].name, syntax_tree_visitor.get_location(names.names[num])));
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -45,7 +45,13 @@ begin
|
|||
var content := &File.ReadAllText(files[i]);
|
||||
if content.StartsWith('//winonly') and IsUnix then
|
||||
continue;
|
||||
|
||||
if content.StartsWith('//exclude') then
|
||||
continue;
|
||||
var errorMessage := '';
|
||||
if content.StartsWith('//!') then
|
||||
begin
|
||||
errorMessage := content.Substring(3, content.IndexOf(System.Environment.NewLine)-3).Trim;
|
||||
end;
|
||||
var co: CompilerOptions := new CompilerOptions(files[i], CompilerOptions.OutputType.ConsoleApplicaton);
|
||||
co.Debug := true;
|
||||
co.OutputDirectory := TestSuiteDir + PathSeparator + 'errors';
|
||||
|
|
@ -70,6 +76,10 @@ begin
|
|||
raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString());
|
||||
System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString());
|
||||
end;
|
||||
if (errorMessage <> '') and (comp.ErrorsList[0].Message.Trim <> errorMessage) then
|
||||
begin
|
||||
System.Windows.Forms.MessageBox.Show('Wrong error message in file ' + files[i] + ', should '+errorMessage+', is '+comp.ErrorsList[0].Message);
|
||||
end;
|
||||
end;
|
||||
if i mod 50 = 0 then
|
||||
System.GC.Collect();
|
||||
|
|
|
|||
Loading…
Reference in a new issue