mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Incorrect handling when reporting fn with optional compile time type #2862
This commit is contained in:
@@ -140,6 +140,7 @@
|
|||||||
- Crash when creating `$Type*` where `$Type` is an optional type #2848
|
- Crash when creating `$Type*` where `$Type` is an optional type #2848
|
||||||
- Crashes when using `io::EOF~!` in various unhandled places. #2848
|
- Crashes when using `io::EOF~!` in various unhandled places. #2848
|
||||||
- Crash when trying to create a const zero untyped list #2847
|
- Crash when trying to create a const zero untyped list #2847
|
||||||
|
- Incorrect handling when reporting fn with optional compile time type #2862
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
||||||
|
|||||||
@@ -3095,6 +3095,8 @@ INLINE const char *type_invalid_storage_type_name(Type *type)
|
|||||||
return "a typeinfo";
|
return "a typeinfo";
|
||||||
case TYPE_WILDCARD:
|
case TYPE_WILDCARD:
|
||||||
return "an empty value";
|
return "an empty value";
|
||||||
|
case TYPE_OPTIONAL:
|
||||||
|
return "an optional with a compile time type";
|
||||||
default:
|
default:
|
||||||
UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fn $typeof({})? foo() {} // #error: A function may not return an optional with a compile time type, only macros may do
|
||||||
|
|
||||||
|
fn int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user