On 10/18/2016 11:10 AM, Pierrick Couderc wrote: > Hi, > > It is supposed to work, but it seems thepattern-matching compiler does > not detect that M0.to_string is non exhaustive, thus it does not add a > Match_Failure in case the variant is unknown. With extensible variants, > a pattern matching is only exhaustive if you provide a wildcard or a > variable for variants added afterwards. Indeed, if I add a catch-all branch in M0.to_string then the code in that branch is run, with no segfault. But I guess my original idea of extending the type doesn't really work as I hoped, since with nested expressions like that, I'd need to find a way for M0.to_string to call back M1.to_string when a `T` is found. Back to the drawing board... Thanks, Andre