[bitc-dev] BitC Records

Swaroop Sridhar swaroop at cs.jhu.edu
Thu Dec 23 19:53:24 EST 2004

In the presence of Record Polymorphism, What is the type of x in

fun x => If  (f ()) then x.a else x.b  ?

It should actually be:

[_={a:_} or _={b:_}]

Do we handle this case, or do we make the conservative assumption that x 
should be of type _={a:_, b:_}?

Again, field-order should not be specified. So we may want to modify out 
tree of types in the following way (if at all it is feasible):

      _={* a:_, b:_} // * means that the record
  	|		has fields a and b in no
	|		particular order
     |	               |
_={a:_, b:_}        _={b:_ , a:_}   // Combinations of
					ordered fields
					will be subtypes

So, the above function will have the type _={* a:_, b:_}.


More information about the bitc-dev mailing list