Throw an error when deserializing a bad type
This error should never be encountered, as long as we always update the get
function when the put function is, as required by get . put == id.
commita0cbe84f1da16337711c2d50ad7b7d3a8f045c15
authorMichael Sondergaard <msond@cs.au.dk>
dateMon 4 Nov 2013, 19:57 (13 years ago)
parentb3d5357
compiler/SourceSyntax/Type.hs+2−1
@@ -93,4 +93,5 @@ instance Binary Type where
9393 1 -> Var <$> get
9494 2 -> Data <$> get <*> get
9595 3 -> return EmptyRecord
96− 4 -> Record <$> get <*> get
96+ 4 -> Record <$> get <*> get
97+ _ -> error "Error reading a valid type from serialized string"