Write template locations when converting to DAML-LF (#2575)

Until now we've omitted them for no good reason. Choice locations
will follow in a separate PR.
This commit is contained in:
Martin Huschenbett 2019-08-16 16:16:45 +02:00 committed by mergify[bot]
parent 6920a6be11
commit 4ae8cfd940
2 changed files with 18 additions and 1 deletions

View File

@ -276,6 +276,7 @@ convertGenericTemplate env x
, Just (polyType, _) <- splitFunTy_maybe (varType create)
, Just (monoTyCon, unwrapCo) <- findMonoTyp polyType
= do
let tplLocation = convNameLoc monoTyCon
polyType <- convertType env polyType
monoType@(TCon monoTyCon) <- convertTyCon env monoTyCon
(unwrapTpl, wrapTpl) <- convertCoercion env unwrapCo
@ -285,7 +286,6 @@ convertGenericTemplate env x
( ETmApp $ mkETyApps (EBuiltin BECoerceContractId) [monoType, polyType]
, ETmApp $ mkETyApps (EBuiltin BECoerceContractId) [polyType, monoType]
)
let tplLocation = Nothing
let tplTypeCon = qualObject monoTyCon
let tplParam = this
let applyThis e = ETmApp e $ unwrapTpl $ EVar this

View File

@ -0,0 +1,17 @@
-- @QUERY-LF .modules[] | .templates[] | select(.tycon.segments == ["A"]) | .location.range | (.start_line == "5.0" and .start_col == "9.0")
-- @QUERY-LF .modules[] | .templates[] | select(.tycon.segments == ["TA"]) | .location.range | (.start_line == "16.0" and .start_col == "18.0")
daml 1.2
module Locations where
template A with
p : Party
where
signatory p
template T a with
p : Party
x : a
where
signatory p
template instance TA = T A