Merge pull request #2430 from SunSerega/fix-2429

Исправление #2429
This commit is contained in:
Ivan Bondarev 2021-02-07 13:49:25 +01:00 committed by GitHub
commit f6d146814f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 5 deletions

View 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.

View file

@ -0,0 +1,6 @@
uses u_partial_2429;
begin
var a := new t1;
Assert(a.f1 = 5);
end.

View file

@ -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;
}