Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler: Make LF 1.13 the default output #9907

Merged
merged 2 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compatibility/bazel_tools/testing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,11 @@ def daml_lf_compatible(sdk_version, platform_version):
# any post 1.10.0 platform supports any pre 1.12 SDK
in_range(platform_version, {"start": "1.10.0-snapshot"}) and not in_range(sdk_version, {"start": "1.12.0-snapshot"})
) or (
# any post 1.11.0 platform supports any SDK
in_range(platform_version, {"start": "1.11.0-snapshot"})
# any post 1.10.0 platform supports any pre 1.14 SDK
in_range(platform_version, {"start": "1.11.0-snapshot"}) and not in_range(sdk_version, {"start": "1.14.0-snapshot"})
) or (
# any post 1.14.0 platform supports any SDK
in_range(platform_version, {"start": "1.14.0-snapshot"})
)

def sdk_platform_test(sdk_version, platform_version):
Expand Down
2 changes: 1 addition & 1 deletion compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ version1_14 = V1 $ PointStable 14

-- | The DAML-LF version used by default.
versionDefault :: Version
versionDefault = version1_12
versionDefault = version1_13
remyhaemmerle-da marked this conversation as resolved.
Show resolved Hide resolved

-- | The DAML-LF development version.
versionDev :: Version
Expand Down
2 changes: 1 addition & 1 deletion compiler/damlc/daml-stdlib-src/DA/BigNumeric.daml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ scale = primitive @"BEScaleBigNumeric"
-- The precision ranges between 0 and 2^16 - 1.
--
-- ```
-- >>> precision 1.1.0
-- >>> precision 1.10
-- 2
-- ```
precision : BigNumeric -> Int
Expand Down
8 changes: 4 additions & 4 deletions compiler/damlc/tests/src/DA/Test/ShakeIdeClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ basicTests mbScenarioService = Tasty.testGroup "Basic tests"
_ <- makeFile "Foo.daml" $ T.unlines
[ "module Foo where"
, "foo : Int"
, "foo = 10.5"
, "foo = 10.5: Decimal"
]
expectOneError (foo,2,6) "Couldn't match expected type"
expectOneError (foo,2,6) "Couldn't match type"

, testCase' "Set buffer modified to introduce error then clear it" $ do
foo <- makeFile "Foo.daml" $ T.unlines
Expand All @@ -153,9 +153,9 @@ basicTests mbScenarioService = Tasty.testGroup "Basic tests"
setBufferModified foo $ T.unlines
[ "module Foo where"
, "foo : Int"
, "foo = 10.5"
, "foo = 10.5: Decimal"
]
expectOneError (foo,2,6) "Couldn't match expected type"
expectOneError (foo,2,6) "Couldn't match type"
setBufferNotModified foo
expectNoErrors

Expand Down
8 changes: 4 additions & 4 deletions compiler/lsp-tests/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ requestTests run _runScenarios = testGroup "requests"
{ _contents = HoverContents $ MarkupContent MkMarkdown $ T.unlines
[ "```daml"
, "1.0"
, ": NumericScale n"
, "=> Numeric n"
, ": (Additive a, IsNumeric a)"
, "=> a"
, "```"
, "* * *"
]
Expand Down Expand Up @@ -619,7 +619,7 @@ stressTests run _runScenarios = testGroup "Stress tests"
-- Even values should produce empty diagnostics
-- while odd values will produce a type error.
fooValue i = T.pack (show (i `div` 2))
<> if even i then "" else ".5"
<> if even i then "" else ".5: Decimal"
fooContent i = T.unlines
[ "module Foo where"
, "foo : Int"
Expand All @@ -644,7 +644,7 @@ stressTests run _runScenarios = testGroup "Stress tests"
assertFailure $ "Incorrect number of diagnostics, expected 1 but got " <> show diags
let msg = head diags ^. message
liftIO $ assertBool ("Expected type error but got " <> T.unpack msg) $
"Couldn't match expected type" `T.isInfixOf` msg
"Couldn't match type" `T.isInfixOf` msg

foo <- openDoc' "Foo.daml" damlId $ fooContent 0
forM_ [1 .. 2000] $ \i -> do
Expand Down
2 changes: 1 addition & 1 deletion daml-lf/language/daml-lf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

lf_version_configuration = {
"legacy": "1.8",
"stable": "1.12",
"stable": "1.13",
"latest": "1.13",
"preview": "1.14",
"dev": "1.dev",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
transactions:
TX #0 1970-01-01T00:00:00Z [Test:48] version: 12
#0:0 version: 12
TX #0 1970-01-01T00:00:00Z [Test:48] version: 13
#0:0 version: 13
│ archived by #1:0
│ referenced by #1:0
│ known to (since): Alice (#0), Bob (#0)
└─> create Test:KeyOps@XXXXXXXX
with: { signatories = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>) }, counterParty = 'Bob' }

TX #1 1970-01-01T00:00:00Z [Test:49] version: 12
#1:0 version: 12
TX #1 1970-01-01T00:00:00Z [Test:49] version: 13
#1:0 version: 13
│ known to (since): Alice (#1), Bob (#1)
└─> Bob exercises Accept:Test:KeyOps@XXXXXXXX on 0066d7eab72b04d1ab3c24f2f3cb2a2d9266c2c2dc769c8b4699b6db3a4f56ec46
with { }
children:
#1:1 version: 12
#1:1 version: 13
│ referenced by #2:0, #3:0, #5:0
│ known to (since): Alice (#1), Bob (#1)
└─> create Test:KeyOps@XXXXXXXX
with: { signatories = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>, Bob -> <unit>) }, counterParty = 'Bob' }

TX #2 1970-01-01T00:00:00Z [Test:51] version: 12
#2:0 version: 12
TX #2 1970-01-01T00:00:00Z [Test:51] version: 13
#2:0 version: 13
│ known to (since): Alice (#2), Bob (#2)
└─> Alice exercises LookupGivenKey:Test:KeyOps@XXXXXXXX on 00541236708d6615d0586a50793ccd77d0bc2b7c51025df96ce743c2469c8d3c95
with { actor = 'Alice', keyMaintainers = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>) } }
children:
#2:1 version: 12
#2:1 version: 13
│ known to (since): Alice (#2), Bob (#2)
└─> lookup by key Test:BasicKey@XXXXXXXX
key { textMap = TextMap(Alice -> <unit>) }
not found

TX #3 1970-01-01T00:00:00Z [Test:54] version: 12
#3:0 version: 12
TX #3 1970-01-01T00:00:00Z [Test:54] version: 13
#3:0 version: 13
│ known to (since): Alice (#3), Bob (#3)
└─> Bob exercises LookupGivenKey:Test:KeyOps@XXXXXXXX on 00541236708d6615d0586a50793ccd77d0bc2b7c51025df96ce743c2469c8d3c95
with { actor = 'Bob', keyMaintainers = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>) } }
children:
#3:1 version: 12
#3:1 version: 13
│ known to (since): Alice (#3), Bob (#3)
└─> lookup by key Test:BasicKey@XXXXXXXX
key { textMap = TextMap(Alice -> <unit>) }
not found

TX #4 1970-01-01T00:00:00Z [Test:57] version: 12
#4:0 version: 12
TX #4 1970-01-01T00:00:00Z [Test:57] version: 13
#4:0 version: 13
│ referenced by #5:1
│ known to (since): Alice (#4)
└─> create Test:BasicKey@XXXXXXXX
with: { owners = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>) } }
key { textMap = TextMap(Alice -> <unit>) }

TX #5 1970-01-01T00:00:00Z [Test:59] version: 12
#5:0 version: 12
TX #5 1970-01-01T00:00:00Z [Test:59] version: 13
#5:0 version: 13
│ known to (since): Alice (#5), Bob (#5)
└─> Alice exercises LookupGivenKey:Test:KeyOps@XXXXXXXX on 00541236708d6615d0586a50793ccd77d0bc2b7c51025df96ce743c2469c8d3c95
with { actor = 'Alice', keyMaintainers = DA.Next.Set:Set@XXXXXXXX{ textMap = TextMap(Alice -> <unit>) } }
children:
#5:1 version: 12
#5:1 version: 13
│ known to (since): Alice (#5), Bob (#5)
└─> lookup by key Test:BasicKey@XXXXXXXX
key { textMap = TextMap(Alice -> <unit>) }
Expand Down
66 changes: 33 additions & 33 deletions daml-lf/tests/scenario/stable/contract-keys/EXPECTED.ledger
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
transactions:
TX #0 1970-01-01T00:00:00Z [Test:77] version: 12
#0:0 version: 12
TX #0 1970-01-01T00:00:00Z [Test:77] version: 13
#0:0 version: 13
│ archived by #8:0
│ referenced by #4:0, #5:0, #8:0
│ known to (since): Alice (#0), Bob (#0)
Expand All @@ -14,127 +14,127 @@ mustFailAt actAs: {'Bob'} readAs: {} [Test:91]

mustFailAt actAs: {'Bob'} readAs: {} [Test:93]

TX #4 1970-01-01T00:00:00Z [Test:96] version: 12
#4:0 version: 12
TX #4 1970-01-01T00:00:00Z [Test:96] version: 13
#4:0 version: 13
│ known to (since): Alice (#4)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "some-key" }
found 0066d7eab72b04d1ab3c24f2f3cb2a2d9266c2c2dc769c8b4699b6db3a4f56ec46

TX #5 1970-01-01T00:00:00Z [Test:100] version: 12
#5:0 version: 12
TX #5 1970-01-01T00:00:00Z [Test:100] version: 13
#5:0 version: 13
│ known to (since): Alice (#5)
└─> ensure active 0066d7eab72b04d1ab3c24f2f3cb2a2d9266c2c2dc769c8b4699b6db3a4f56ec46

TX #6 1970-01-01T00:00:00Z [Test:104] version: 12
#6:0 version: 12
TX #6 1970-01-01T00:00:00Z [Test:104] version: 13
#6:0 version: 13
│ known to (since): Alice (#6)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "blah" }
not found

TX #7 1970-01-01T00:00:00Z [Test:108] version: 12
#7:0 version: 12
TX #7 1970-01-01T00:00:00Z [Test:108] version: 13
#7:0 version: 13
│ known to (since): Bob (#7)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Bob', _2 = "some-key" }
not found

TX #8 1970-01-01T00:00:00Z [Test:112] version: 12
#8:0 version: 12
TX #8 1970-01-01T00:00:00Z [Test:112] version: 13
#8:0 version: 13
│ known to (since): Alice (#8), Bob (#8)
└─> Alice exercises TextKeyChoice:Test:TextKey@XXXXXXXX on 0066d7eab72b04d1ab3c24f2f3cb2a2d9266c2c2dc769c8b4699b6db3a4f56ec46
with { }


TX #9 1970-01-01T00:00:00Z [Test:115] version: 12
#9:0 version: 12
TX #9 1970-01-01T00:00:00Z [Test:115] version: 13
#9:0 version: 13
│ known to (since): Alice (#9)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "some-key" }
not found

TX #10 1970-01-01T00:00:00Z [Test:121] version: 12
#10:0 version: 12
TX #10 1970-01-01T00:00:00Z [Test:121] version: 13
#10:0 version: 13
│ archived by #11:0
│ referenced by #11:0
│ known to (since): Alice (#10), Bob (#10)
└─> create Test:TextKey@XXXXXXXX
with: { p = 'Alice', k = "some-key-2", disclosedTo = ['Bob'] }
key { _1 = 'Alice', _2 = "some-key-2" }

TX #11 1970-01-01T00:00:00Z [Test:126] version: 12
#11:0 version: 12
TX #11 1970-01-01T00:00:00Z [Test:126] version: 13
#11:0 version: 13
│ known to (since): Alice (#11), Bob (#11)
└─> Alice exercises TextKeyChoice:Test:TextKey@XXXXXXXX on 004f56105c00ca4026b905ed27b104471dffcaf2de15832139b93ef46b87000232
with { }


#11:1 version: 12
#11:1 version: 13
│ known to (since): Alice (#11)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "some-key-2" }
not found

TX #12 1970-01-01T00:00:00Z [Test:132] version: 12
#12:0 version: 12
TX #12 1970-01-01T00:00:00Z [Test:132] version: 13
#12:0 version: 13
│ referenced by #12:1
│ known to (since): Alice (#12)
└─> create Test:TextKey@XXXXXXXX
with: { p = 'Alice', k = "same-submit-key", disclosedTo = [] }
key { _1 = 'Alice', _2 = "same-submit-key" }

#12:1 version: 12
#12:1 version: 13
│ known to (since): Alice (#12)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "same-submit-key" }
found 00a95ea3bb21422ab003f15dc95de204110b3f7f2682b407a2ba75d36b0be9053b

TX #13 1970-01-01T00:00:00Z [Test:140] version: 12
#13:0 version: 12
TX #13 1970-01-01T00:00:00Z [Test:140] version: 13
#13:0 version: 13
│ referenced by #14:0
│ known to (since): Alice (#13)
└─> create Test:CreateAndLookup@XXXXXXXX
with: { p = 'Alice', k = "same-choice-key" }

TX #14 1970-01-01T00:00:00Z [Test:144] version: 12
#14:0 version: 12
TX #14 1970-01-01T00:00:00Z [Test:144] version: 13
#14:0 version: 13
│ known to (since): Alice (#14)
└─> Alice exercises Good:Test:CreateAndLookup@XXXXXXXX on 00528ef7ca096fcc1cfb640394394117e237d21236faef81c544770ec5962c462c
with { }
children:
#14:1 version: 12
#14:1 version: 13
│ referenced by #14:2, #14:3
│ known to (since): Alice (#14)
└─> create Test:TextKey@XXXXXXXX
with: { p = 'Alice', k = "same-choice-key", disclosedTo = [] }
key { _1 = 'Alice', _2 = "same-choice-key" }
#14:2 version: 12
#14:2 version: 13
│ known to (since): Alice (#14)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "same-choice-key" }
found 00ce68df68a7e42ecadca4ff1e4d35ffff75f009d1f01ae130d36116e1332ff773
#14:3 version: 12
#14:3 version: 13
│ known to (since): Alice (#14)
└─> ensure active 00ce68df68a7e42ecadca4ff1e4d35ffff75f009d1f01ae130d36116e1332ff773

mustFailAt actAs: {'Alice'} readAs: {} [Test:147]

TX #16 1970-01-01T00:00:00Z [Test:151] version: 12
#16:0 version: 12
TX #16 1970-01-01T00:00:00Z [Test:151] version: 13
#16:0 version: 13
│ referenced by #16:1, #16:2
│ known to (since): Alice (#16)
└─> create Test:TextKey@XXXXXXXX
with: { p = 'Alice', k = "non-consuming-choice", disclosedTo = [] }
key { _1 = 'Alice', _2 = "non-consuming-choice" }

#16:1 version: 12
#16:1 version: 13
│ known to (since): Alice (#16)
└─> Alice exercises TextKeyNonconsumingChoice:Test:TextKey@XXXXXXXX on 00bcf23c0f4133f226e7051a79ab289277e1a3941dcf08c545ff477593c9b22651
with { }


#16:2 version: 12
#16:2 version: 13
│ known to (since): Alice (#16)
└─> lookup by key Test:TextKey@XXXXXXXX
key { _1 = 'Alice', _2 = "non-consuming-choice" }
Expand Down
14 changes: 7 additions & 7 deletions daml-lf/tests/scenario/stable/divulge-iou/EXPECTED.ledger
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
transactions:
TX #0 1970-01-01T00:00:00Z [Test:12] version: 12
#0:0 version: 12
TX #0 1970-01-01T00:00:00Z [Test:12] version: 13
#0:0 version: 13
│ referenced by #2:1
│ known to (since): Alice (#0), AlicesBank (#0), Bob (#2)
└─> create Test:Iou@XXXXXXXX
with: { payer = 'AlicesBank', owner = 'Alice', amount = Test:Amount@XXXXXXXX{ value = 1.0000000000, currency = "USD" } }

TX #1 1970-01-01T00:00:00Z [Test:17] version: 12
#1:0 version: 12
TX #1 1970-01-01T00:00:00Z [Test:17] version: 13
#1:0 version: 13
│ referenced by #2:0
│ known to (since): AlicesBank (#1), Bob (#1)
└─> create Test:DivulgeIouByExercise@XXXXXXXX
with: { payer = 'AlicesBank', divulgee = 'Bob' }

TX #2 1970-01-01T00:00:00Z [Test:20] version: 12
#2:0 version: 12
TX #2 1970-01-01T00:00:00Z [Test:20] version: 13
#2:0 version: 13
│ known to (since): AlicesBank (#2), Bob (#2)
└─> AlicesBank exercises Divulge:Test:DivulgeIouByExercise@XXXXXXXX on 00999d35e67dc49f91772eaffd08179f431661a382cd68edc7d25ee2c2508fb6a3
with { ref = 00a21310a64aec150c16589881ebebc4780fc8e476489ef939a1ebfbfeb1aa3835 }
children:
#2:1 version: 12
#2:1 version: 13
│ known to (since): AlicesBank (#2), Bob (#2)
└─> ensure active 00a21310a64aec150c16589881ebebc4780fc8e476489ef939a1ebfbfeb1aa3835

Expand Down
4 changes: 2 additions & 2 deletions daml-lf/tests/scenario/stable/gen-map/EXPECTED.ledger
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
transactions:
TX #0 1970-01-01T00:00:00Z [Test:18] version: 12
#0:0 version: 12
TX #0 1970-01-01T00:00:00Z [Test:18] version: 13
#0:0 version: 13
│ known to (since): Alice (#0)
└─> create Test:MapTemplate@XXXXXXXX
with: { party = 'Alice', value = GenMap(1 -> "c", 2 -> "a", 5 -> "b") }
Expand Down
4 changes: 2 additions & 2 deletions daml-lf/tests/scenario/stable/many-fields/EXPECTED.ledger
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
transactions:
TX #0 1970-01-01T00:00:00Z [Test:26] version: 12
#0:0 version: 12
TX #0 1970-01-01T00:00:00Z [Test:26] version: 13
#0:0 version: 13
│ known to (since): Alice (#0)
└─> create Test:BigTemplate@XXXXXXXX
with: { p = 'Alice', x000 = 0, x001 = 1, x002 = 2, x003 = 3, x004 = 4, x005 = 5, x006 = 6, x007 = 7, x008 = 8, x009 = 9, x010 = 10, x011 = 11, x012 = 12, x013 = 13, x014 = 14, x015 = 15, x016 = 16, x017 = 17, x018 = 18, x019 = 19, x020 = 20, x021 = 21, x022 = 22, x023 = 23, x024 = 24, x025 = 25, x026 = 26, x027 = 27, x028 = 28, x029 = 29, x030 = 30, x031 = 31, x032 = 32, x033 = 33, x034 = 34, x035 = 35, x036 = 36, x037 = 37, x038 = 38, x039 = 39, x040 = 40, x041 = 41, x042 = 42, x043 = 43, x044 = 44, x045 = 45, x046 = 46, x047 = 47, x048 = 48, x049 = 49, x050 = 50, x051 = 51, x052 = 52, x053 = 53, x054 = 54, x055 = 55, x056 = 56, x057 = 57, x058 = 58, x059 = 59, x060 = 60, x061 = 61, x062 = 62, x063 = 63, x064 = 64, x065 = 65, x066 = 66, x067 = 67, x068 = 68, x069 = 69, x070 = 70, x071 = 71, x072 = 72, x073 = 73, x074 = 74, x075 = 75, x076 = 76, x077 = 77, x078 = 78, x079 = 79, x080 = 80, x081 = 81, x082 = 82, x083 = 83, x084 = 84, x085 = 85, x086 = 86, x087 = 87, x088 = 88, x089 = 89, x090 = 90, x091 = 91, x092 = 92, x093 = 93, x094 = 94, x095 = 95, x096 = 96, x097 = 97, x098 = 98, x099 = 99, x100 = 100, x101 = 101, x102 = 102, x103 = 103, x104 = 104, x105 = 105, x106 = 106, x107 = 107, x108 = 108, x109 = 109, x110 = 110, x111 = 111, x112 = 112, x113 = 113, x114 = 114, x115 = 115, x116 = 116, x117 = 117, x118 = 118, x119 = 119 }
Expand Down
Loading