This commit is contained in:
parent
1a882ee112
commit
4a70f38e39
|
|
@ -4046,7 +4046,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
public void read_is_pattern_expr(is_pattern_expr _is_pattern_expr)
|
||||
{
|
||||
read_expression(_is_pattern_expr);
|
||||
read_addressed_value(_is_pattern_expr);
|
||||
_is_pattern_expr.left = _read_node() as expression;
|
||||
_is_pattern_expr.right = _read_node() as pattern_node;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6250,7 +6250,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
public void write_is_pattern_expr(is_pattern_expr _is_pattern_expr)
|
||||
{
|
||||
write_expression(_is_pattern_expr);
|
||||
write_addressed_value(_is_pattern_expr);
|
||||
if (_is_pattern_expr.left == null)
|
||||
{
|
||||
bw.Write((byte)0);
|
||||
|
|
|
|||
|
|
@ -48708,7 +48708,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
///
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class is_pattern_expr : expression
|
||||
public partial class is_pattern_expr : addressed_value
|
||||
{
|
||||
|
||||
///<summary>
|
||||
|
|
|
|||
|
|
@ -2893,7 +2893,7 @@
|
|||
</TagIndices>
|
||||
</Tags>
|
||||
</SyntaxNode>
|
||||
<SyntaxNode Name="is_pattern_expr" BaseName="expression">
|
||||
<SyntaxNode Name="is_pattern_expr" BaseName="addressed_value">
|
||||
<Fields>
|
||||
<SyntaxField Name="left" SyntaxType="expression" />
|
||||
<SyntaxField Name="right" SyntaxType="pattern_node" />
|
||||
|
|
|
|||
4
TestSuite/errors/err0501.pas
Normal file
4
TestSuite/errors/err0501.pas
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
//!Сопоставление с образцом не поддерживается в данном контексте
|
||||
begin
|
||||
(2 is object(var o1)).print;
|
||||
end.
|
||||
|
|
@ -5,4 +5,20 @@
|
|||
begin
|
||||
var l: List<t1> := nil;
|
||||
if (l <> nil) and (l[0] is t2(var a)) then ;
|
||||
l := new List<t1>();
|
||||
var o := new t2;
|
||||
l.Add(o);
|
||||
if (l <> nil) and (l[0] is t2(var a)) then
|
||||
begin
|
||||
assert(a = o);
|
||||
o := nil;
|
||||
end;
|
||||
assert(o = nil);
|
||||
l := new List<t1>();
|
||||
l.Add(new t1);
|
||||
if (l <> nil) and (l[0] is t2(var a)) then
|
||||
begin
|
||||
o := new t2;
|
||||
end;
|
||||
assert(o = nil);
|
||||
end.
|
||||
Loading…
Reference in a new issue