pike.git/
src/
pike_types.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2020-10-02
2020-10-02 13:47:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>
f8b10478e9ca993ab2216ada9bd41cff86de7afb (
19
lines) (+
18
/-
1
)
[
Show
|
Annotate
]
Branch:
master
Compiler
[Typechecker]
: Short-circuit double type inversions.
1085:
} /* FALLTHRU */ case T_MULTISET:
-
case T_NOT:
+
case T_TYPE: case PIKE_T_AUTO: /* Make a new type of the top type, and put it in car. */
1094:
PT_COPY_CAR); break;
+
case T_NOT:
+
/* Make a new type of the top type, and put it in car.
+
*
+
* Special case: Remove double inversions.
+
*/
+
{
+
struct pike_type *t = *Pike_compiler->type_stackp;
+
if (t->type == T_NOT) {
+
*Pike_compiler->type_stackp = t->car;
+
add_ref(t->car);
+
free_type(t);
+
break;
+
}
+
*Pike_compiler->type_stackp = mk_type(type, t, NULL, PT_COPY_CAR);
+
}
+
break;
+
case T_SCOPE: case T_ASSIGN: case T_INT: