Don't loose signatures in template let binding (#8136)

* update ghc-lib patch

* update stack-snapshot.yaml

changelog_begin
changelog_end

* bazel run @stackage-unpinned//:pin (on linux) and update stackage_snapshot.json

* testcase to check type signatures in template-lets are not ignored

* update to ghc-lib commit hash following merge

* update snapshot

* update snapshot after pin on windows

* update stack pin on linux

Co-authored-by: Nick Chapman <nchapman@digitalasset.com>
This commit is contained in:
nickchapman-da 2020-12-03 15:08:02 +00:00 committed by GitHub
parent d3899368ff
commit 0867605e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 13 deletions

View File

@ -12,7 +12,7 @@ jobs:
variables:
ghc-lib-sha: '77fcc42eef2256ba9bb61a7e442a65bedb19a35d'
base-sha: '9c787d4d24f2b515934c8503ee2bbd7cfac4da20'
patches: '8b7ba525f1f327397ccae770af4f5973f53c7786 833ca63be2ab14871874ccb6974921e8952802e9'
patches: 'f41bf7627453acbd457766173820cabe60d7fad3 833ca63be2ab14871874ccb6974921e8952802e9'
flavor: 'ghc-8.8.1'
steps:
- checkout: self

View File

@ -0,0 +1,28 @@
-- Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its affiliates.
-- All rights reserved.
module TemplateLetWithSignatures where
-- This example should fail to type check.
-- There was a bug reported: https://github.com/digital-asset/daml/issues/7902
-- which indicated that the signature was being ignored.
-- It is now not ignored, and the example does indeed fail to type check.
-- TODO: only report the type error once, instead of 5 times!
template T
with
p : Party
where
signatory p
let q : Int
q = p
choice C : ()
controller q
do pure ()
-- @ERROR Couldn't match expected type Int with actual type Party
-- @ERROR Couldn't match expected type Int with actual type Party
-- @ERROR Couldn't match expected type Int with actual type Party
-- @ERROR Couldn't match expected type Int with actual type Party
-- @ERROR Couldn't match expected type Int with actual type Party

View File

@ -3,10 +3,10 @@
resolver: lts-14.1
packages:
- archive: https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz
sha256: "5d73af2df22e55711500402d8d209ae9b5bf486120442cd2dceed6ba92e98756"
- archive: https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz
sha256: "4fd0a4d6d818b0e170d75061005fd0d4988288b3b26a3f07983f9971ee48a980"
- archive: https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-086a06e8f84b5227e5f63b1dc01b768a.tar.gz
sha256: "9b7977a09120100b9be5aee0319b88a0cd232a60271b36efaa0a2f5ea7544621"
- archive: https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-086a06e8f84b5227e5f63b1dc01b768a.tar.gz
sha256: "714ddb325da3320ed7012cec7005f4f47a54cb9e6e4bed6817869c0eaf0306b2"
- github: digital-asset/hlint
commit: "3e78bce69749b22a80fec1e8eb853cc0c100c18e"
sha256: "cf39f2b378485afc77ffdad4dbb057d5d9b4dfc5a38c76ddc44e920e537fb0fa"

View File

@ -1,6 +1,6 @@
{
"__GENERATED_FILE_DO_NOT_MODIFY_MANUALLY": -286311109,
"all-cabal-hashes": "https://raw.githubusercontent.com/commercialhaskell/all-cabal-hashes/ae12d9b008e12b50542ed592d789705eec52798a",
"__GENERATED_FILE_DO_NOT_MODIFY_MANUALLY": 993415215,
"all-cabal-hashes": "https://raw.githubusercontent.com/commercialhaskell/all-cabal-hashes/ddcf59b7f97123f20d0038f36e83a3c32ff204a5",
"resolved": {
"Cabal": {"dependencies":["array","base","binary","bytestring","containers","deepseq","directory","filepath","mtl","parsec","pretty","process","text","time","transformers","unix"],"location":{"type":"core"},"name":"Cabal","version":"2.4.1.0"},
"Decimal": {"dependencies":["base","deepseq"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/Decimal-0.5.1/Decimal-0.5.1.tar.gz"},"name":"Decimal","pinned":{"url":["https://hackage.haskell.org/package/Decimal-0.5.1/Decimal-0.5.1.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/Decimal-0.5.1.tar.gz"],"sha256":"575ca5c65a8ea5a5bf2cd7b794a0d16622082cb501bf4b0327c5895c0b80f34c","cabal-sha256":"06bdd0f8badfb2104fd052f64888c283792a08f9a0d3661339e133e073080299"},"version":"0.5.1"},
@ -94,8 +94,8 @@
"ghc": {"dependencies":[],"location":{"type":"core"},"name":"ghc","version":"8.6.5"},
"ghc-boot": {"dependencies":[],"location":{"type":"core"},"name":"ghc-boot","version":"8.6.5"},
"ghc-boot-th": {"dependencies":[],"location":{"type":"core"},"name":"ghc-boot-th","version":"8.6.5"},
"ghc-lib": {"dependencies":["alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-lib-parser","ghc-prim","happy","hpc","pretty","process","time","transformers","unix"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz"},"name":"ghc-lib","pinned":{"sha256":"5d73af2df22e55711500402d8d209ae9b5bf486120442cd2dceed6ba92e98756","strip-prefix":"ghc-lib-8.8.1.20201109"},"version":"8.8.1.20201109"},
"ghc-lib-parser": {"dependencies":["alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-prim","happy","hpc","pretty","process","time","transformers","unix"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz"},"name":"ghc-lib-parser","pinned":{"sha256":"4fd0a4d6d818b0e170d75061005fd0d4988288b3b26a3f07983f9971ee48a980","strip-prefix":"ghc-lib-parser-8.8.1.20201109"},"version":"8.8.1.20201109"},
"ghc-lib": {"dependencies":["alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-lib-parser","ghc-prim","happy","hpc","pretty","process","time","transformers","unix"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-086a06e8f84b5227e5f63b1dc01b768a.tar.gz"},"name":"ghc-lib","pinned":{"sha256":"9b7977a09120100b9be5aee0319b88a0cd232a60271b36efaa0a2f5ea7544621","strip-prefix":"ghc-lib-8.8.1.20201203"},"version":"8.8.1.20201203"},
"ghc-lib-parser": {"dependencies":["alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-prim","happy","hpc","pretty","process","time","transformers","unix"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-086a06e8f84b5227e5f63b1dc01b768a.tar.gz"},"name":"ghc-lib-parser","pinned":{"sha256":"714ddb325da3320ed7012cec7005f4f47a54cb9e6e4bed6817869c0eaf0306b2","strip-prefix":"ghc-lib-parser-8.8.1.20201203"},"version":"8.8.1.20201203"},
"ghc-lib-parser-ex": {"dependencies":["base","bytestring","containers","extra","ghc-lib-parser","uniplate"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/ghc-lib-parser-ex-8.8.5.8/ghc-lib-parser-ex-8.8.5.8.tar.gz"},"name":"ghc-lib-parser-ex","pinned":{"url":["https://hackage.haskell.org/package/ghc-lib-parser-ex-8.8.5.8/ghc-lib-parser-ex-8.8.5.8.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/ghc-lib-parser-ex-8.8.5.8.tar.gz"],"sha256":"b36ef8b49da4e8c78b00dca9b9546b7d4db0b09b10da5e313d3f0dbb4af581d7","cabal-sha256":"04f164fd6a4a5b0c5627cf7fadd79174c3b1d4c696dc481a9909266bd6a2a6aa"},"version":"8.8.5.8"},
"ghc-paths": {"dependencies":["Cabal","base","directory"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/ghc-paths-0.1.0.9/ghc-paths-0.1.0.9.tar.gz"},"name":"ghc-paths","pinned":{"url":["https://hackage.haskell.org/package/ghc-paths-0.1.0.9/ghc-paths-0.1.0.9.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/ghc-paths-0.1.0.9.tar.gz"],"sha256":"afa68fb86123004c37c1dc354286af2d87a9dcfb12ddcb80e8bd0cd55bc87945","cabal-sha256":"ed18df7b53699446dabd66f6e019e5b156820f0301d8dec0d6385f13b797e0ba"},"version":"0.1.0.9"},
"ghc-prim": {"dependencies":[],"location":{"type":"core"},"name":"ghc-prim","version":"0.5.3"},

View File

@ -1,6 +1,6 @@
{
"__GENERATED_FILE_DO_NOT_MODIFY_MANUALLY": 1016593406,
"all-cabal-hashes": "https://raw.githubusercontent.com/commercialhaskell/all-cabal-hashes/23119b649cdeeb0d2c4691a80fd99e0648598bb0",
"__GENERATED_FILE_DO_NOT_MODIFY_MANUALLY": -714985599,
"all-cabal-hashes": "https://raw.githubusercontent.com/commercialhaskell/all-cabal-hashes/ddcf59b7f97123f20d0038f36e83a3c32ff204a5",
"resolved": {
"Cabal": {"dependencies":["Win32","array","base","binary","bytestring","containers","deepseq","directory","filepath","mtl","parsec","pretty","process","text","time","transformers"],"location":{"type":"core"},"name":"Cabal","version":"2.4.1.0"},
"Decimal": {"dependencies":["base","deepseq"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/Decimal-0.5.1/Decimal-0.5.1.tar.gz"},"name":"Decimal","pinned":{"url":["https://hackage.haskell.org/package/Decimal-0.5.1/Decimal-0.5.1.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/Decimal-0.5.1.tar.gz"],"sha256":"575ca5c65a8ea5a5bf2cd7b794a0d16622082cb501bf4b0327c5895c0b80f34c","cabal-sha256":"06bdd0f8badfb2104fd052f64888c283792a08f9a0d3661339e133e073080299"},"version":"0.5.1"},
@ -95,8 +95,8 @@
"ghc": {"dependencies":[],"location":{"type":"core"},"name":"ghc","version":"8.6.5"},
"ghc-boot": {"dependencies":[],"location":{"type":"core"},"name":"ghc-boot","version":"8.6.5"},
"ghc-boot-th": {"dependencies":[],"location":{"type":"core"},"name":"ghc-boot-th","version":"8.6.5"},
"ghc-lib": {"dependencies":["Win32","alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-lib-parser","ghc-prim","happy","hpc","pretty","process","time","transformers"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz"},"name":"ghc-lib","pinned":{"sha256":"5d73af2df22e55711500402d8d209ae9b5bf486120442cd2dceed6ba92e98756","strip-prefix":"ghc-lib-8.8.1.20201109"},"version":"8.8.1.20201109"},
"ghc-lib-parser": {"dependencies":["Win32","alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-prim","happy","hpc","pretty","process","time","transformers"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-188559a1c65f9a4c19ac8e983ed79cd6.tar.gz"},"name":"ghc-lib-parser","pinned":{"sha256":"4fd0a4d6d818b0e170d75061005fd0d4988288b3b26a3f07983f9971ee48a980","strip-prefix":"ghc-lib-parser-8.8.1.20201109"},"version":"8.8.1.20201109"},
"ghc-lib": {"dependencies":["Win32","alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-lib-parser","ghc-prim","happy","hpc","pretty","process","time","transformers"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-086a06e8f84b5227e5f63b1dc01b768a.tar.gz"},"name":"ghc-lib","pinned":{"sha256":"9b7977a09120100b9be5aee0319b88a0cd232a60271b36efaa0a2f5ea7544621","strip-prefix":"ghc-lib-8.8.1.20201203"},"version":"8.8.1.20201203"},
"ghc-lib-parser": {"dependencies":["Win32","alex","array","base","binary","bytestring","containers","deepseq","directory","filepath","ghc-prim","happy","hpc","pretty","process","time","transformers"],"location":{"type":"archive","url":"https://daml-binaries.da-ext.net/da-ghc-lib/ghc-lib-parser-086a06e8f84b5227e5f63b1dc01b768a.tar.gz"},"name":"ghc-lib-parser","pinned":{"sha256":"714ddb325da3320ed7012cec7005f4f47a54cb9e6e4bed6817869c0eaf0306b2","strip-prefix":"ghc-lib-parser-8.8.1.20201203"},"version":"8.8.1.20201203"},
"ghc-lib-parser-ex": {"dependencies":["base","bytestring","containers","extra","ghc-lib-parser","uniplate"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/ghc-lib-parser-ex-8.8.5.8/ghc-lib-parser-ex-8.8.5.8.tar.gz"},"name":"ghc-lib-parser-ex","pinned":{"url":["https://hackage.haskell.org/package/ghc-lib-parser-ex-8.8.5.8/ghc-lib-parser-ex-8.8.5.8.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/ghc-lib-parser-ex-8.8.5.8.tar.gz"],"sha256":"b36ef8b49da4e8c78b00dca9b9546b7d4db0b09b10da5e313d3f0dbb4af581d7","cabal-sha256":"04f164fd6a4a5b0c5627cf7fadd79174c3b1d4c696dc481a9909266bd6a2a6aa"},"version":"8.8.5.8"},
"ghc-paths": {"dependencies":["Cabal","base","directory"],"location":{"type":"hackage","url":"https://hackage.haskell.org/package/ghc-paths-0.1.0.9/ghc-paths-0.1.0.9.tar.gz"},"name":"ghc-paths","pinned":{"url":["https://hackage.haskell.org/package/ghc-paths-0.1.0.9/ghc-paths-0.1.0.9.tar.gz","https://s3.amazonaws.com/hackage.fpcomplete.com/package/ghc-paths-0.1.0.9.tar.gz"],"sha256":"afa68fb86123004c37c1dc354286af2d87a9dcfb12ddcb80e8bd0cd55bc87945","cabal-sha256":"ed18df7b53699446dabd66f6e019e5b156820f0301d8dec0d6385f13b797e0ba"},"version":"0.1.0.9"},
"ghc-prim": {"dependencies":[],"location":{"type":"core"},"name":"ghc-prim","version":"0.5.3"},