commit
f6d146814f
23
TestSuite/units/u_partial_2429.pas
Normal file
23
TestSuite/units/u_partial_2429.pas
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
unit u_partial_2429;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
t1 = partial class
|
||||
function f1: integer;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
type
|
||||
t0<T> = class
|
||||
function f0 := 5;
|
||||
end;
|
||||
//Ошибка: Неизвестное имя 't1`1'
|
||||
t1 = partial class(t0<byte>)
|
||||
|
||||
end;
|
||||
|
||||
function t1.f1 := self.f0;
|
||||
|
||||
begin end.
|
||||
6
TestSuite/usesunits/use_partial_2429.pas
Normal file
6
TestSuite/usesunits/use_partial_2429.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
uses u_partial_2429;
|
||||
|
||||
begin
|
||||
var a := new t1;
|
||||
Assert(a.f1 = 5);
|
||||
end.
|
||||
|
|
@ -2251,11 +2251,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
tmp = tmp.TopScope;
|
||||
}
|
||||
}
|
||||
if (_ctn != null && _ctn.base_generic_instance != null)
|
||||
{
|
||||
return _ctn.base_generic_instance.ConvertSymbolInfo(sil);
|
||||
}
|
||||
|
||||
|
||||
// для partial-классов, наследующих от интерфейса в секции Implementation
|
||||
// Надо ещё добавить условия чтобы только для них. А то может найти не то что надо!!!
|
||||
if (sil == null && this.converted_type != null && this.converted_type.IsPartial)
|
||||
|
|
@ -2263,6 +2259,11 @@ namespace PascalABCCompiler.TreeConverter
|
|||
sil = this.converted_namespace.scope.Find(name);
|
||||
}
|
||||
|
||||
if (_ctn != null && _ctn.base_generic_instance != null)
|
||||
{
|
||||
return _ctn.base_generic_instance.ConvertSymbolInfo(sil);
|
||||
}
|
||||
|
||||
return sil;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue