Tuples
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user