Skip to content

Commit

Permalink
Updates release notes for PR #4124
Browse files Browse the repository at this point in the history
  • Loading branch information
ponylang-main committed Jul 5, 2022
1 parent 922350a commit 06a9542
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .release-notes/4124.md

This file was deleted.

25 changes: 25 additions & 0 deletions .release-notes/next-release.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 06a9542

Please sign in to comment.