mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
language: fix: missing template instances in package (#2884)
The package compiled via daml migrate was missing the actual Upgrade/Rollback templates. This is because we used `type` instead of `template instance` to define those templates. Also, apparently we need to export UpgradeInstance/RollbackInstance from DA.Upgrade in the standard library.
This commit is contained in:
parent
01eccf2c64
commit
41aa03c711
@ -92,9 +92,10 @@ generateUpgradeModule templateNames modName qualA qualB =
|
||||
|
||||
upgradeTemplates :: String -> [String]
|
||||
upgradeTemplates n =
|
||||
[ "type " <> n <> "Upgrade = Upgrade A." <> n <> " B." <> n
|
||||
, "type " <> n <> "Rollback = Rollback A." <> n <> " B." <> n
|
||||
[ "template instance " <> n <> "Upgrade = Upgrade A." <> n <> " B." <> n
|
||||
, "template instance " <> n <> "Rollback = Rollback A." <> n <> " B." <> n
|
||||
, "instance Convertible A." <> n <> " B." <> n
|
||||
, "instance Convertible B." <> n <> " A." <> n
|
||||
]
|
||||
|
||||
-- | Generate the full source for a daml-lf package.
|
||||
|
@ -12,6 +12,8 @@ module DA.Upgrade
|
||||
, Convertible(..)
|
||||
, GenConvertible
|
||||
, Upgrade(..)
|
||||
, UpgradeInstance(..)
|
||||
, RollbackInstance(..)
|
||||
, Rollback(..)
|
||||
)
|
||||
where
|
||||
|
@ -8,7 +8,8 @@ import FooB qualified as B
|
||||
import FooAInstances()
|
||||
import FooBInstances()
|
||||
import DA.Upgrade
|
||||
type FooUpgrade = Upgrade A.Foo B.Foo
|
||||
type FooRollback = Rollback A.Foo B.Foo
|
||||
template instance FooUpgrade = Upgrade A.Foo B.Foo
|
||||
template instance FooRollback = Rollback A.Foo B.Foo
|
||||
instance Convertible A.Foo B.Foo
|
||||
instance Convertible B.Foo A.Foo
|
||||
|
||||
|
@ -8,8 +8,8 @@ import FooB qualified as B
|
||||
import FooAInstances()
|
||||
import FooBInstances()
|
||||
import DA.Upgrade
|
||||
type FooUpgrade = Upgrade A.Foo B.Foo
|
||||
type FooRollback = Rollback A.Foo B.Foo
|
||||
template instance FooUpgrade = Upgrade A.Foo B.Foo
|
||||
template instance FooRollback = Rollback A.Foo B.Foo
|
||||
|
||||
instance Convertible A.Foo B.Foo where
|
||||
convert d = B.Foo with a = d.a; p = d.p; t = "upgraded"
|
||||
|
Loading…
Reference in New Issue
Block a user