@@ -188,18 +188,22 @@ genDependencies a = forM_ (references a) $ \name -> do
188188genSimpleType :: TypeName -> Xsd.SimpleType -> [Xsd.Annotation]-> Gen ()
189189genSimpleType tn (Xsd.AtomicType restriction ann) parentAnn = do
190190 let
191− baseName r = case Xsd.restrictionBase r of
191+ baseName r = case Xsd.simpleRestrictionBase r of
192192 Xsd.Ref n -> Just n
193193 Xsd.Inline (Xsd.AtomicType r' _) -> baseName r'
194194 Xsd.Inline (Xsd.ListType _ _) -> Nothing
195+ Xsd.Inline (Xsd.UnionType _ _) -> Nothing
195196 case baseName restriction of
196197 Just _
197198 | isEnum restriction
198− -> genEnum tn (Xsd.restrictionConstraints restriction) (parentAnn <> ann)
199+ -> genEnum tn
200+ (Xsd.simpleRestrictionConstraints restriction)
201+ (parentAnn <> ann)
199202 Just base ->
200203 genNewtype tn base (parentAnn <> ann)
201204 _ -> genUnsupported tn
202205genSimpleType typeName (Xsd.ListType _ _) _ = genUnsupported typeName
206+genSimpleType typeName (Xsd.UnionType _ _) _ = genUnsupported typeName
203207
204208genNewtype :: TypeName -> Xsd.QName -> [Xsd.Annotation] -> Gen ()
205209genNewtype tn base annots = do
@@ -238,8 +242,8 @@ genEnum tn constraints annots = do
238242 : enumLines
239243 writeCode [""]
240244
241−isEnum :: Xsd.Restriction -> Bool
242−isEnum = any isEnumConstraint . Xsd.restrictionConstraints
245+isEnum :: Xsd.SimpleRestriction -> Bool
246+isEnum = any isEnumConstraint . Xsd.simpleRestrictionConstraints
243247 where
244248 isEnumConstraint (Xsd.Enumeration _) = True
245249
@@ -292,7 +296,7 @@ genFields typeName (Xsd.ContentComplex (Xsd.ComplexContentExtension e)) = do
292296 fields <- maybe (return []) (genFieldsForModel typeName)
293297 (Xsd.complexExtensionModel e)
294298 return (baseFields ++ fields)
295−genFields _ (Xsd.ContentComplex Xsd.ComplexContentRestriction) =
299+genFields _ (Xsd.ContentComplex (Xsd.ComplexContentRestriction _)) =
296300 return []
297301
298302genFieldsForModel :: TypeName -> Xsd.ModelGroup -> Gen [Text]