Remove Optional definition in LF conversion (#3973)

All references to Optional are already mapped to the builtin Optional
type in LF but we forgot to filter out the type definition.

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Moritz Kiefer 2020-01-08 11:32:41 +01:00 committed by GitHub
parent 17a5abf25a
commit 86951ea106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -382,6 +382,7 @@ convertTypeDef env o@(ATyCon t) = withRange (convNameLoc t) $ if
| NameIn DA_Internal_LF n <- t
, n `elementOfUniqSet` internalTypes
-> pure []
| NameIn DA_Internal_Prelude "Optional" <- t -> pure []
-- Consumption marker types used to transfer information from template desugaring to LF conversion.
| NameIn DA_Internal_Desugar n <- t
, n `elementOfUniqSet` consumingTypes
@ -778,7 +779,7 @@ convertBind env (name, x)
-- during conversion to DAML-LF together with their constructors since we
-- deliberately remove 'GHC.Types.Opaque' as well.
internalTypes :: UniqSet FastString
internalTypes = mkUniqSet ["Scenario","Update","ContractId","Time","Date","Party","Pair", "TextMap", "Map", "Any", "TypeRep"]
internalTypes = mkUniqSet ["Scenario","Update","ContractId","Time","Date","Party","Pair", "TextMap", "Map", "Any", "TypeRep", "Optional"]
consumingTypes :: UniqSet FastString
consumingTypes = mkUniqSet ["PreConsuming", "PostConsuming", "NonConsuming"]