This commit is contained in:
Бондарев Иван 2018-04-05 20:54:02 +02:00
parent 25d2217b13
commit 9489fd596e
2 changed files with 8 additions and 1 deletions

6
TestSuite/question5.pas Normal file
View file

@ -0,0 +1,6 @@
function f1 := 1;
function f2 := 0;
begin
var i := true ? f1 : f2;
assert(i = 1);
end.

View file

@ -16777,7 +16777,8 @@ namespace PascalABCCompiler.TreeConverter
condition = convertion_data_and_alghoritms.convert_type(condition, SystemLibrary.SystemLibrary.bool_type);
expression_node left = convert_strong(node.ret_if_true);
expression_node right = convert_strong(node.ret_if_false);
try_convert_typed_expression_to_function_call(ref left);
try_convert_typed_expression_to_function_call(ref right);
/*var typeComparisonResult = type_table.compare_types(left.type, right.type);
if (typeComparisonResult == type_compare.greater_type)
right = convertion_data_and_alghoritms.convert_type(right, left.type);