fix #1914
This commit is contained in:
parent
795b4e79f8
commit
b8e6248094
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "4";
|
public const string Minor = "4";
|
||||||
public const string Build = "2";
|
public const string Build = "2";
|
||||||
public const string Revision = "2036";
|
public const string Revision = "2037";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%MINOR%=4
|
|
||||||
%REVISION%=2036
|
|
||||||
%COREVERSION%=2
|
%COREVERSION%=2
|
||||||
|
%REVISION%=2037
|
||||||
|
%MINOR%=4
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.4.2.2036'
|
!define VERSION '3.4.2.2037'
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ type
|
||||||
/// Правый нижний угол графического объекта
|
/// Правый нижний угол графического объекта
|
||||||
property RightBottom: Point read Pnt(Left + Height,Top + Height);
|
property RightBottom: Point read Pnt(Left + Height,Top + Height);
|
||||||
/// Угол поворота графического объекта (по часовой стрелке)
|
/// Угол поворота графического объекта (по часовой стрелке)
|
||||||
property RotateAngle: real read InvokeReal(()->rot.Angle) write Invoke(procedure->rot.Angle := value);
|
property RotateAngle: real read InvokeReal(()->rot.Angle) write Invoke(procedure->begin rot.CenterX := Width/2; rot.CenterY := Height/2; rot.Angle := value end);
|
||||||
/// Множитель масштабирования объекта
|
/// Множитель масштабирования объекта
|
||||||
property ScaleFactor: real read InvokeReal(()->sca.ScaleX) write Invoke(()->begin (sca.ScaleX, sca.ScaleY) := (value,value); end);
|
property ScaleFactor: real read InvokeReal(()->sca.ScaleX) write Invoke(()->begin (sca.ScaleX, sca.ScaleY) := (value,value); end);
|
||||||
// Центр поворота графического объекта - запретил, т.к. это будет сбивать координаты объекта
|
// Центр поворота графического объекта - запретил, т.к. это будет сбивать координаты объекта
|
||||||
|
|
@ -439,13 +439,24 @@ type
|
||||||
CircleWPF = class(BoundedObjectWPF)
|
CircleWPF = class(BoundedObjectWPF)
|
||||||
private
|
private
|
||||||
procedure InitOb2(x,y,r: real; c: GColor) := InitOb1(x-r,y-r,2*r,2*r,c,new System.Windows.Shapes.Ellipse());
|
procedure InitOb2(x,y,r: real; c: GColor) := InitOb1(x-r,y-r,2*r,2*r,c,new System.Windows.Shapes.Ellipse());
|
||||||
procedure WT(value: real) := (ob.Width,ob.Height) := (value,value);
|
procedure WT(value: real) := begin (ob.Width,ob.Height) := (value,value); (gr.Width,gr.Height) := (value,value); end;
|
||||||
procedure HT(value: real) := (ob.Width,ob.Height) := (value,value);
|
procedure HT(value: real) := begin (ob.Width,ob.Height) := (value,value); (gr.Width,gr.Height) := (value,value); end;
|
||||||
|
|
||||||
|
{procedure Rad(value: real);
|
||||||
|
begin
|
||||||
|
var delta := value - gr.Width/2;
|
||||||
|
Left -= delta;
|
||||||
|
Top -= delta;
|
||||||
|
(gr.Width,gr.Height) := (value*2,value*2);
|
||||||
|
Element.Points := ChangePointCollection(value,n);
|
||||||
|
end;}
|
||||||
|
|
||||||
procedure Rad(value: real);
|
procedure Rad(value: real);
|
||||||
begin
|
begin
|
||||||
//(ob as Ellipse).RenderedGeometry
|
//(ob as Ellipse).RenderedGeometry
|
||||||
Left -= value - ob.Width/2;
|
Left -= value - gr.Width/2;
|
||||||
Top -= value - ob.Width/2;
|
Top -= value - gr.Width/2;
|
||||||
|
(gr.Width,gr.Height) := (value*2,value*2);
|
||||||
(ob.Width,ob.Height) := (value*2,value*2);
|
(ob.Width,ob.Height) := (value*2,value*2);
|
||||||
end;
|
end;
|
||||||
function GetInternalGeometry: Geometry; override := (ob as Shape).RenderedGeometry;
|
function GetInternalGeometry: Geometry; override := (ob as Shape).RenderedGeometry;
|
||||||
|
|
@ -662,7 +673,7 @@ type
|
||||||
write Invoke(()->begin Self.Element.bc := value; Self.Element.RecreateFormText; ob.InvalidateVisual end);
|
write Invoke(()->begin Self.Element.bc := value; Self.Element.RecreateFormText; ob.InvalidateVisual end);
|
||||||
/// Текст графического объекта
|
/// Текст графического объекта
|
||||||
property Text: string read InvokeString(()->Element.Text)
|
property Text: string read InvokeString(()->Element.Text)
|
||||||
write Invoke(procedure->begin Self.Element.Text := value; Self.Element.RecreateFormText; ; Width := Self.Element.Width; Height := Self.Element.Height; ob.InvalidateVisual end); override;
|
write Invoke(procedure->begin Self.Element.Text := value; Self.Element.RecreateFormText; Width := Self.Element.Width; Height := Self.Element.Height; ob.InvalidateVisual end); override;
|
||||||
/// Декоратор поворота объекта
|
/// Декоратор поворота объекта
|
||||||
function WithRotate(da: real): TextWPF := inherited WithRotate(da) as TextWPF;
|
function WithRotate(da: real): TextWPF := inherited WithRotate(da) as TextWPF;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
5
TestSuite/question_point_Nullable.pas
Normal file
5
TestSuite/question_point_Nullable.pas
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
begin
|
||||||
|
var x: integer?;
|
||||||
|
var a := x?.ToString();
|
||||||
|
Assert(a=nil);
|
||||||
|
end.
|
||||||
14
TestSuite/question_point_Nullable_2.pas
Normal file
14
TestSuite/question_point_Nullable_2.pas
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
type
|
||||||
|
T = record
|
||||||
|
y := 1;
|
||||||
|
function ToString: string; override := y.ToString;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function F(x: T?): string;
|
||||||
|
begin
|
||||||
|
Result := x?.ToString();
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
assert(f(new T)='1');
|
||||||
|
end.
|
||||||
|
|
@ -108,7 +108,13 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
public void semantic_check_dot_question(SyntaxTree.question_colon_expression qce)
|
public void semantic_check_dot_question(SyntaxTree.question_colon_expression qce)
|
||||||
{
|
{
|
||||||
var av = convert_strong((qce.condition as bin_expr).left);
|
var av = convert_strong((qce.condition as bin_expr).left);
|
||||||
if (!av.type.is_class)
|
Type t = null;
|
||||||
|
if (av.type is compiled_generic_instance_type_node ctn2)
|
||||||
|
t = ctn2.compiled_original_generic.compiled_type;
|
||||||
|
else if (av.type is compiled_type_node ctn1)
|
||||||
|
t = ctn1.compiled_type;
|
||||||
|
|
||||||
|
if (!av.type.is_class && !(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)))
|
||||||
AddError(av.location, "OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE");
|
AddError(av.location, "OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue