From 22e613204ef84ddb9af0667020d0cdf51394b2cd Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Sun, 19 Jan 2025 18:05:49 +0000 Subject: [PATCH] Add assert --- src/libponyc/type/matchtype.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libponyc/type/matchtype.c b/src/libponyc/type/matchtype.c index 90e6218a79..398200695d 100644 --- a/src/libponyc/type/matchtype.c +++ b/src/libponyc/type/matchtype.c @@ -596,7 +596,15 @@ static matchtype_t is_nominal_match_entity(ast_t* operand, ast_t* pattern, ast_error_frame(errorf, o_cap, "this would be possible if the subcap were more ephemeral. " "Perhaps you meant to consume this variable"); - } + } + else + { + // While working on fixing issue 4579, Joe and I became convinced that + // any code that ends up going down this path is buggy and we should + // assert. It is possible that we are wrong, but nothing in the ponyc + // test suite ends up here at the time we added the assert. + pony_assert(0); + } return MATCHTYPE_DENY_CAP; }