feat: type checking feedback
This commit is contained in:
parent
20de6b6bcc
commit
0a7edf19c4
|
@ -204,11 +204,21 @@ const Expression = ({
|
||||||
);
|
);
|
||||||
opsCount += 1;
|
opsCount += 1;
|
||||||
}
|
}
|
||||||
|
const [lastOp] = ops.slice(-1);
|
||||||
|
let realType;
|
||||||
|
if (isKey(lastOp)) {
|
||||||
|
realType = description.args
|
||||||
|
? 'function'
|
||||||
|
: description.type;
|
||||||
|
}
|
||||||
|
if (isInvocation(lastOp)) {
|
||||||
|
realType = description.type;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classnames(
|
className={classnames(
|
||||||
'expression',
|
'expression',
|
||||||
{'wrong-type': type !== 'void'},
|
{'wrong-type': realType !== type},
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{Renderables}
|
{Renderables}
|
||||||
|
|
|
@ -2,9 +2,14 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
button, .button {
|
button, .button {
|
||||||
color: #00bdd6;
|
color: #00bdd6;
|
||||||
}
|
}
|
||||||
|
&.wrong-type {
|
||||||
|
background-color: rgba(255, 0, 0, 0.4);
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.expression__invocation-toggle-wrapper {
|
.expression__invocation-toggle-wrapper {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user