mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
$and, $or, $is_const, $assignable, .is_eq, .is_ordered, $defined($vatype(2)) works looking if we can create a type, $defined(foo[0]) $defined(foo()). Remove $checks and @checked. Improvide casting checks to always work without destructive changes.
This commit is contained in:
committed by
Christoffer Lerno
parent
8a12dc5bd4
commit
9af37fe427
@@ -217,7 +217,7 @@ macro Object* Object.object_from_value(&self, value) @private
|
||||
$case $Type.typeid == void*.typeid:
|
||||
if (value != null) return CastResult.TYPE_MISMATCH?;
|
||||
return &NULL_OBJECT;
|
||||
$case $checks(String s = value):
|
||||
$case $assignable(value, String):
|
||||
return new_string(value, self.allocator);
|
||||
$default:
|
||||
$error "Unsupported object type.";
|
||||
@@ -307,7 +307,6 @@ fn void Object.set_object_at(&self, usz index, Object* to_set)
|
||||
|
||||
/**
|
||||
* @require $Type.kindof.is_int() "Expected an integer type."
|
||||
* @checked ($Type)1.0 "Expected an integer type."
|
||||
**/
|
||||
macro get_integer_value(Object* value, $Type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user