microsoft / Power-Fx

Power Fx low-code programming language
MIT License
3.21k stars 329 forks source link

Introduce RecordOf to get record type from a table type #2739

Open adithyaselv opened 1 week ago

adithyaselv commented 1 week ago

Introduce RecordOf syntax to get record type from a table type.

eg:

Account := Type(RecordOf(Accounts));

Points := Type([{x : Number, y : Number}]); 
Point := Type(RecordOf(Points));
 distance(a: Point, b: Point): Number = Sqrt(Power(b.x-a.x, 2) + Power(b.y-a.y, 2));

RecordOf works only within a TypeLiteral . Lays foundations for future type helpers (eg: Union multiple record types ... ) that we may have.

LucGenetier commented 1 week ago

✅ No public API change.

LucGenetier commented 1 week ago

✅ No public API change.

LucGenetier commented 6 days ago

✅ No public API change.