mirror of https://github.com/AMT-Cheif/drift.git
Resolve types for case expressions
This commit is contained in:
parent
9c07eaa465
commit
d9f5cf0e69
|
@ -91,6 +91,8 @@ class TypeResolver {
|
||||||
}
|
}
|
||||||
} else if (expr is BetweenExpression) {
|
} else if (expr is BetweenExpression) {
|
||||||
return const ResolveResult(ResolvedType.bool());
|
return const ResolveResult(ResolvedType.bool());
|
||||||
|
} else if (expr is CaseExpression) {
|
||||||
|
return resolveExpression(expr.whens.first.then);
|
||||||
} else if (expr is SubQuery) {
|
} else if (expr is SubQuery) {
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
@ -247,7 +249,8 @@ class TypeResolver {
|
||||||
ResolveResult _argumentType(Expression parent, Expression argument) {
|
ResolveResult _argumentType(Expression parent, Expression argument) {
|
||||||
if (parent is IsExpression ||
|
if (parent is IsExpression ||
|
||||||
parent is BinaryExpression ||
|
parent is BinaryExpression ||
|
||||||
parent is BetweenExpression) {
|
parent is BetweenExpression ||
|
||||||
|
parent is CaseExpression) {
|
||||||
final relevant = parent.childNodes
|
final relevant = parent.childNodes
|
||||||
.lastWhere((node) => node is Expression && node != argument);
|
.lastWhere((node) => node is Expression && node != argument);
|
||||||
return resolveExpression(relevant as Expression);
|
return resolveExpression(relevant as Expression);
|
||||||
|
|
Loading…
Reference in New Issue