diff --git a/releasenotes.md b/releasenotes.md index ba58c2546..5bb46e94b 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,5 +1,13 @@ # C3C Release Notes +## 0.7.8 Change list +### Changes / improvements + +### Fixes +- `Foo.is_eq` would return false if the type was a `typedef` and had an overload, but the underlying type was not comparable. + +### Stdlib changes + ## 0.7.7 Change list ### Changes / improvements diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index f25e4b09f..8f7373a13 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -5760,7 +5760,7 @@ static bool sema_expr_rewrite_to_type_property(SemaContext *context, Expr *expr, expr_rewrite_const_bool(expr, type_bool, type_is_ordered(flat)); return true; case TYPE_PROPERTY_IS_EQ: - switch (sema_type_can_check_equality_with_overload(context, flat)) + switch (sema_type_can_check_equality_with_overload(context, type)) { case BOOL_ERR: return false; diff --git a/src/version.h b/src/version.h index d94be3bd1..9624ba0e1 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ -#define COMPILER_VERSION "0.7.7" -#define PRERELEASE 0 +#define COMPILER_VERSION "0.7.8" +#define PRERELEASE 1 diff --git a/test/test_suite/distinct/distinct_is_eq.c3 b/test/test_suite/distinct/distinct_is_eq.c3 new file mode 100644 index 000000000..39684e2f5 --- /dev/null +++ b/test/test_suite/distinct/distinct_is_eq.c3 @@ -0,0 +1,12 @@ +module test; +import std; +struct Boo { int a; } +typedef Foo = Boo; + +fn bool Foo.eq(Foo a, Foo b) @operator(==) => false; + +fn int main() +{ + $assert Foo.is_eq; + return 0; +} \ No newline at end of file