This commit is contained in:
Michael Schimmel
2026-01-04 17:06:59 +01:00
parent 8914d59607
commit a4afae6f39
10 changed files with 655 additions and 211 deletions
+3 -3
View File
@@ -301,7 +301,7 @@ var
staticType: IStaticType;
genRec: IGenericRecordDefinition;
idx: Integer;
methodType: IStaticType;
methodType: IMethodType;
begin
// Verify that IMainService was analyzed correctly into an AST definition
staticType := TRtlTypeRegistry.GetStaticType(TypeInfo(IMainService));
@@ -309,13 +309,13 @@ begin
Assert.AreNotEqual(TStaticTypeKind.stUnknown, staticType.Kind, 'Type should be known');
Assert.AreEqual(TStaticTypeKind.stGenericRecord, staticType.Kind, 'Interface should map to GenericRecord');
genRec := staticType.GenericDefinition;
genRec := staticType.AsGenericRecord.GenericDefinition;
// Check 'Add' method existence
idx := genRec.IndexOf(Myc.Data.Keyword.TKeywordRegistry.Intern('Add'));
Assert.IsTrue(idx >= 0, 'Method Add should exist in type definition');
methodType := genRec.Items[idx];
methodType := genRec.Items[idx].AsMethod;
Assert.AreEqual(TStaticTypeKind.stMethod, methodType.Kind);
// Add has 2 args (Ordinal, Ordinal) -> Ordinal
Assert.AreEqual(Int64(2), Length(methodType.Signatures[0].ParamTypes));