From 06a9542b666be82a9ad95cba84cc79dd001f57a9 Mon Sep 17 00:00:00 2001 From: Ponylang Main Bot Date: Tue, 5 Jul 2022 18:38:57 +0000 Subject: [PATCH] Updates release notes for PR #4124 --- .release-notes/4124.md | 24 ------------------------ .release-notes/next-release.md | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 .release-notes/4124.md diff --git a/.release-notes/4124.md b/.release-notes/4124.md deleted file mode 100644 index beb32d2751..0000000000 --- a/.release-notes/4124.md +++ /dev/null @@ -1,24 +0,0 @@ -## Allow constructor expressions to be auto-recovered in assignments or arguments - -Previously for the following code: - -```pony -actor Main - new create(env: Env) => - Bar.take_foo(Foo(88)) - let bar: Foo iso = Foo(88) - -class Foo - new create(v: U8) => - None - -primitive Bar - fun take_foo(foo: Foo iso) => - None -``` - -You'd get compilation errors "argument not assignable to parameter" and "right side must be a subtype of left side" for the two lines in `Main.create()`. - -We've added checks to see if the constructor expressions can be implicitly auto-recovered, and if they can, no compilation error is generated. - -This only applies to cases where the type of the parameter (or the `let` binding) is a simple type, i.e. not a union, intersection or tuple type. diff --git a/.release-notes/next-release.md b/.release-notes/next-release.md index e69de29bb2..0576d58f18 100644 --- a/.release-notes/next-release.md +++ b/.release-notes/next-release.md @@ -0,0 +1,25 @@ +## Allow constructor expressions to be auto-recovered in assignments or arguments + +Previously for the following code: + +```pony +actor Main + new create(env: Env) => + Bar.take_foo(Foo(88)) + let bar: Foo iso = Foo(88) + +class Foo + new create(v: U8) => + None + +primitive Bar + fun take_foo(foo: Foo iso) => + None +``` + +You'd get compilation errors "argument not assignable to parameter" and "right side must be a subtype of left side" for the two lines in `Main.create()`. + +We've added checks to see if the constructor expressions can be implicitly auto-recovered, and if they can, no compilation error is generated. + +This only applies to cases where the type of the parameter (or the `let` binding) is a simple type, i.e. not a union, intersection or tuple type. +