Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaselv committed Dec 12, 2024
1 parent 4b8b4d6 commit 9ee7506
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public override bool PreVisit(CallNode node)

public override bool PreVisit(ListNode node)
{
if (node.Parent != null && node.Parent is CallNode cn && ValidRecordOfNode(cn))
if (node.Parent is CallNode cn && ValidRecordOfNode(cn))
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public void TestUDTErrors(string typeDefinition, int expectedErrorCount, string

// RecordOf record type
[InlineData("Point := Type({ x: Number, y: Number }); PointR := Type(RecordOf(Point)); ", "ErrNamedType_InvalidTypeDefinition")]

// Inline definitions within RecordOf
[InlineData("T1 := Type(RecordOf(Type([{A:Number}])));", "ErrTypeLiteral_InvalidTypeDefinition")]
[InlineData("T1 := Type(RecordOf(RecordOf([{x:Number, y:Number}])));", "ErrTypeLiteral_InvalidTypeDefinition")]
public void TestRecordOfErrors(string typeDefinition, string expectedMessageKey)
{
var checkResult = new DefinitionsCheckResult()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ public void UDFImperativeVsRecordAmbiguityTest(string udf, string evalExpression
true,
42.0)]

// Fails for anyother type other than table
// Fails for any type other than table
[InlineData(
"Account := Type(RecordOf(SomeRecord));",
"",
Expand Down Expand Up @@ -2101,6 +2101,14 @@ public void UDFImperativeVsRecordAmbiguityTest(string udf, string evalExpression
"Point := Type(RecordOf([{x : Number, y : Number}]));",
"",
false)]
[InlineData(
"T1 := Type(RecordOf(Type([{A:Number}])));",
"",
false)]
[InlineData(
"T1 := Type(RecordOf(RecordOf([{x:Number, y:Number}])));",
"",
false)]

// RecordOf not in type literal
[InlineData(
Expand Down

0 comments on commit 9ee7506

Please sign in to comment.