This commit is contained in:
Бондарев Иван 2020-08-17 16:55:39 +02:00
parent 9071a4786a
commit f80eb0eddf
3 changed files with 22 additions and 1 deletions

View file

@ -383,7 +383,7 @@ namespace PascalABCCompiler.PCU
if (this.base_generic_instance != null && sil != null)
{
var bsil = base_generic_instance.ConvertSymbolInfo(sil);
if (orig_generic_or_null == null)
if (orig_generic_or_null == null && name != "op_Implicit")
return bsil;
}
foreach (SymbolInfo si in sil)

View file

@ -0,0 +1,14 @@
unit u_generics4;
type
c1<T> = class
public static function operator implicit(o: T): c1<T> := nil;
end;
c2<T1, T2> = class(c1<T2>) end;
end.

View file

@ -0,0 +1,7 @@
uses u_generics4;
function f1: c1<byte> := new c2<word, byte>;
begin
var o := f1;
assert(o <> nil);
end.