mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-24 10:30:54 +00:00
fix assert statement checks
This commit is contained in:
@@ -27,8 +27,10 @@ class AssertStatement extends Statement {
|
||||
|
||||
if (this.message) {
|
||||
const msg_value = this.message.resolveExpression(vi);
|
||||
if (!(msg_value instanceof JavaType) || !isTypeAssignable(vi.typemap.get('java/lang/String'), msg_value)) {
|
||||
vi.problems.push(ParseProblem.Error(this.message.tokens, `String expression expected`));
|
||||
if (!(msg_value instanceof JavaType)) {
|
||||
vi.problems.push(ParseProblem.Error(this.message.tokens, `Expression expected`));
|
||||
} else if (msg_value === PrimitiveType.map.V) {
|
||||
vi.problems.push(ParseProblem.Error(this.message.tokens, `Expression type cannot be 'void'`));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user