This commit is contained in:
parent
9a501e237d
commit
673e3882c9
6
TestSuite/question9.pas
Normal file
6
TestSuite/question9.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
begin
|
||||
var x := true ? byte(3) : byte(2);
|
||||
assert(x.GetType = typeof(byte));
|
||||
var x1 := true ? word(4) : shortint(3);
|
||||
assert(x1.GetType() = typeof(integer));
|
||||
end.
|
||||
|
|
@ -3033,9 +3033,10 @@ namespace PascalABCCompiler.TreeConverter
|
|||
tn1 = tn2;
|
||||
tn2 = t;
|
||||
}
|
||||
if (n1 == n2) return tn1;
|
||||
// Первый тип - меньше или равен
|
||||
if ((int)n1 <= (int)int_types.integer_type && (int)n2 <= (int)int_types.integer_type) return SystemLibrary.SystemLibrary.integer_type;
|
||||
if (n1 == n2) return tn1;
|
||||
|
||||
// Первый тип - меньше
|
||||
if ((int)n2 == (int)int_types.uint64_type)
|
||||
return SystemLibrary.SystemLibrary.uint64_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue