#type RecordType = tuple or object #Error: type mismatch: got ((string, int))
#but expected one of:ttypecom.printFields(rec: RecordType)
type RecordType = (tuple or object)
#proc printFields(rec: tuple or object) = #is Ok
proc printFields(rec: RecordType) =
for key, value in fieldPairs(rec):
echo key, " = ", value
var student = ("yrs",22)
printFields(student)
type
Person = object
name:string
age:int
var teacher = Person(name:"gz",age:53)
printFields(teacher)