pike.git/
src/
pike_types.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2022-04-01
2022-04-01 16:40:36 by Henrik Grubbström (Grubba) <grubba@grubba.org>
953a10fd91c29de73acdc2f8a52219b9b2b2dafb (
29
lines) (+
19
/-
10
)
[
Show
|
Annotate
]
Branch:
master
Compiler
[Typechecker]
: Improve handling of PIKE_T_TRANSITIVE some more.
5281:
case TWOT(PIKE_T_TRANSITIVE, T_MANY): if (op == PT_BINOP_AND) { type_stack_mark();
-
tmp = low_type_binop(op, a->
cdr
, b,
NULL
, aflags, bflags, remap_flags);
+
tmp = low_type_binop(op, a->
car
, b,
remap
, aflags, bflags, remap_flags);
push_finished_type(tmp);
-
+
if (tmp || !a->car) {
free_type(tmp);
-
tmp = low_type_binop(op, a->
car
, b,
remap
, aflags, bflags, remap_flags);
+
tmp = low_type_binop(op, a->
cdr
, b,
NULL
, aflags, bflags, remap_flags);
+
if (tmp) {
push_finished_type(tmp); free_type(tmp);
-
push_type(PIKE_T_TRANSITIVE);
+
push_
reverse_
type(PIKE_T_TRANSITIVE);
+
}
+
}
return pop_unfinished_type(); } /* FALLTHRU */
5301:
case TWOT(T_MANY, PIKE_T_TRANSITIVE): if (op == PT_BINOP_AND) { type_stack_mark();
-
tmp = low_type_binop(op, a, b->
cdr
,
NULL
, aflags, bflags, remap_flags);
+
tmp = low_type_binop(op, a, b->
car
,
remap
, aflags, bflags, remap_flags);
push_finished_type(tmp);
-
+
if (tmp || !b->car) {
free_type(tmp);
-
tmp = low_type_binop(op, a, b->
car
,
remap
, aflags, bflags, remap_flags);
+
tmp = low_type_binop(op, a, b->
cdr
,
NULL
, aflags, bflags, remap_flags);
+
if (tmp) {
push_finished_type(tmp); free_type(tmp);
-
push_type(PIKE_T_TRANSITIVE);
+
push_
reverse_
type(PIKE_T_TRANSITIVE);
+
}
+
}
return pop_unfinished_type(); } /* FALLTHRU */