cloudRoutine / issueCommRepo

Sample Port of F# Uservoice Suggestions
0 stars 0 forks source link

Allow record types to implement interfaces just by adding the interface name when compatible #68

Open cloudRoutine opened 7 years ago

cloudRoutine commented 7 years ago

Allow record types to implement interfaces just by adding the interface name when compatible [12838959]

Submitted by Pierre Irrmann on 3/7/2016 12:00:00 AM
[ 32 votes ]

When a record type already has all the members necessary to impement an interface, it could implement it without having to write the code. For instance: type IHasAnAge = abstract member Age: int type Person = { Name : string Age: int } with interface IHasAnAge