mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Foo.is_eq would return false if the type was a typedef and had an overload, but the underlying type was not comparable. Version 0.7.8.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#define COMPILER_VERSION "0.7.7"
|
||||
#define PRERELEASE 0
|
||||
#define COMPILER_VERSION "0.7.8"
|
||||
#define PRERELEASE 1
|
||||
|
||||
12
test/test_suite/distinct/distinct_is_eq.c3
Normal file
12
test/test_suite/distinct/distinct_is_eq.c3
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user