Skip to content

Commit

Permalink
Updates release notes for PR #4152
Browse files Browse the repository at this point in the history
  • Loading branch information
ponylang-main committed Jun 24, 2022
1 parent 4059631 commit 5dea90a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .release-notes/4152.md

This file was deleted.

20 changes: 20 additions & 0 deletions .release-notes/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,23 @@ mark and sweep passes.

After we re-added the ability to override the return type for FFI function calls in a [previous release](https://github.com/ponylang/ponyc/releases/tag/0.50.0), we forgot to reintroduce some checks in the compiler that ensured that the specified return types would be known to the code generation pass. This caused some programs that introduced a new type (for example, a bare lambda) in the context of a FFI return type to crash the compiler. This is now fixed.

## Support void* (Pointer[None]) parameters in bare lambdas and functions

Unlike conventional FFI functions, bare lambdas `@{(...)}` and bare functions `fun @bare() => ...` did not support `Pointer[None]` parameters, Pony's equivalent of `void*`. This is despite the fact that like FFI functions, bare lambdas and functions are strictly intended for use with FFI calls and callbacks.

This commit allows bare lambdas and bare functions with `Pointer[None]` parameters to accept arguments of any `Pointer[A]` type for these parameters. Therefore, code like the following now works:

```pony
use @printf[I32](fmt: Pointer[None] tag, ...)
actor Main
new create(env: Env) =>
let printer = @{(fmt: Pointer[None] tag): I32 => @printf(fmt)}
let cb = this~print()
printer("Hello".cstring())
cb(" world!\n".cstring())
fun @print(fmt: Pointer[None]): I32 =>
@printf(fmt)
```

0 comments on commit 5dea90a

Please sign in to comment.