Skip to content

break outside loop causes compiler assertion #12483

@Simn

Description

@Simn
function main() {
	@:coroutine function f() {
		break;
	}
}
Fatal error: exception Failure("hd")
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Stdlib__List.hd in file "list.ml" (inlined), line 30, characters 10-23
Called from CoroFromTexpr.expr_to_coro.loop in file "src/coro/coroFromTexpr.ml", line 217, characters 44-65
Called from CoroFromTexpr.expr_to_coro.loop_assign in file "src/coro/coroFromTexpr.ml", line 380, characters 11-24

The typer doesn't error hard enough for the coro transformer to not run, and it then gets confused.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions