This commit is contained in:
parent
4817fd07e1
commit
903e6ed63c
18
TestSuite/nil7.pas
Normal file
18
TestSuite/nil7.pas
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
type
|
||||||
|
t0 = class end;
|
||||||
|
|
||||||
|
t1 = class
|
||||||
|
static function operator implicit(p: t0): t1 := new t1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var obj: t1;
|
||||||
|
|
||||||
|
procedure p1(o: t1);
|
||||||
|
begin
|
||||||
|
obj := o;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
p1(t0(nil));
|
||||||
|
assert(obj <> nil);
|
||||||
|
end.
|
||||||
|
|
@ -1727,10 +1727,10 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
exprs[i].type = fn.parameters[fn.parameters.Count - 1].type;
|
exprs[i].type = fn.parameters[fn.parameters.Count - 1].type;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((ptcal[i]==null)||(ptcal[i].first==null)||exprs[i] is null_const_node)
|
if ((ptcal[i] == null) || (ptcal[i].first == null) || (exprs[i] is null_const_node && exprs[i].type is null_type_node))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
expression_node[] temp_arr = new expression_node[1];
|
expression_node[] temp_arr = new expression_node[1];
|
||||||
temp_arr[0] = exprs[i];
|
temp_arr[0] = exprs[i];
|
||||||
if (ptcal[i].first.convertion_method is compiled_constructor_node)
|
if (ptcal[i].first.convertion_method is compiled_constructor_node)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue