Skip to content

Commit

Permalink
Left side of assignment can be a cast operation
Browse files Browse the repository at this point in the history
This is done solely to explain away how assignment works outside strict
namespace blocks. Do not use this feature in actual code. This feature might be
removed in the future.
  • Loading branch information
positively-charged committed Jan 30, 2017
1 parent 8c88c38 commit fbe819b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/semantic/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ void test_cast( struct semantic* semantic, struct expr_test* test,
result->spec = cast->spec;
result->complete = true;
result->usable = true;
result->modifiable = operand.modifiable;
if ( operand.folded ) {
result->value = operand.value;
result->folded = true;
Expand Down Expand Up @@ -1307,7 +1308,7 @@ void invalid_cast( struct semantic* semantic, struct cast* cast,
str_init( &operand_type_s );
s_present_type( &operand_type, &operand_type_s );
s_diag( semantic, DIAG_POS_ERR, &cast->pos,
"%s operand cannot be cast to %s",
"operand (`%s`) cannot be cast to specified type (`%s`)",
operand_type_s.value, cast_type_s.value );
str_deinit( &cast_type_s );
str_deinit( &operand_type_s );
Expand Down

0 comments on commit fbe819b

Please sign in to comment.