[m-dev.] Does dynamic_cast/2 preserve typeclass info?

Ralph Becket rbeck at microsoft.com
Fri Mar 2 04:01:43 AEDT 2001


If I have

	func f(t(T)) = u <= tc(T)

and do

	if dynamic_cast(X, Y) then f(Y) else ...

should I expect this to work if X is an existentially quantified type
that may indeed be a t(T) <= tc(T)?

Rats!  It won't because dynamic_cast/2 uses univ_value/1 whose
signature is not sufficient to report such information.

Any ideas how I might work around this one?

Cheers,

Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list