This commit is contained in:
parent
fd2300c303
commit
5c4b3f1de4
|
|
@ -7614,6 +7614,7 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
&& !(value.obj is ICommonConstructorCall) && !(value.obj is ICommonNamespaceFunctionCallNode)
|
&& !(value.obj is ICommonConstructorCall) && !(value.obj is ICommonNamespaceFunctionCallNode)
|
||||||
&& !(value.obj is ICommonNestedInFunctionFunctionCallNode)
|
&& !(value.obj is ICommonNestedInFunctionFunctionCallNode)
|
||||||
&& !(value.obj is IQuestionColonExpressionNode)
|
&& !(value.obj is IQuestionColonExpressionNode)
|
||||||
|
&& !(value.obj is IDoubleQuestionColonExpressionNode)
|
||||||
&& !(value.obj.conversion_type != null && !value.obj.conversion_type.is_value_type))
|
&& !(value.obj.conversion_type != null && !value.obj.conversion_type.is_value_type))
|
||||||
{
|
{
|
||||||
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.obj.type).tp);
|
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.obj.type).tp);
|
||||||
|
|
|
||||||
17
TestSuite/double_question6.pas
Normal file
17
TestSuite/double_question6.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
type
|
||||||
|
r1 = record
|
||||||
|
x: integer;
|
||||||
|
constructor(x: integer) := self.x := x;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function f0 := new r1($12345678);
|
||||||
|
|
||||||
|
function f1(n: r1?) := (n??f0).Value;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Выводит 0 вместо 12345678
|
||||||
|
assert(f1(nil).x.ToString('X') = '12345678');
|
||||||
|
var rec: r1;
|
||||||
|
rec.x := 4;
|
||||||
|
assert(f1(rec).x.ToString('X') = '4');
|
||||||
|
end.
|
||||||
9
TestSuite/double_question7.pas
Normal file
9
TestSuite/double_question7.pas
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
function f0 := $12345678;
|
||||||
|
|
||||||
|
function f1(n: integer?) := (n??f0).Value;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Выводит 0 вместо 12345678
|
||||||
|
assert(f1(nil).ToString('X') = '12345678');
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue