Skip to content

Compiler Assertion on default argument assignment to ephemeral mutable type #4089

@ergl

Description

@ergl

Starting with ponyc 0.49.1, the following Pony code:

class Foo

actor Main
  fun apply(x: Foo iso^ = Foo) => None

  new create(env: Env) =>
    None

causes the compiler to crash with the following assertion error:

# ./build/debug/ponyc crash_examples
Building builtin -> ~/dev/ponylang/ponyc/packages/builtin
Building crash_examples -> ~/dev/ponylang/ponyc/crash_examples
~/../src/libponyc/expr/reference.c:178: expr_param: Assertion `0` failed.

Backtrace functionality not available.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Abort trap: 6

Changing x: Foo iso^ to x: Foo trn^ will also reproduce the issue.

This issue is related to #4018, as the above code compiled with ponyc 0.49.0.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions