Commit fb3a3163 authored by Jürg Billeter's avatar Jürg Billeter

Replace SemanticAnalyzer with CodeContext in CodeNode.check parameter

parent 2cd44b16
...@@ -72,14 +72,14 @@ public class Vala.AddressofExpression : Expression { ...@@ -72,14 +72,14 @@ public class Vala.AddressofExpression : Expression {
return inner.is_pure (); return inner.is_pure ();
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (checked) { if (checked) {
return !error; return !error;
} }
checked = true; checked = true;
if (!inner.check (analyzer)) { if (!inner.check (context)) {
error = true; error = true;
return false; return false;
} }
......
...@@ -128,11 +128,11 @@ public class Vala.ArrayCreationExpression : Expression { ...@@ -128,11 +128,11 @@ public class Vala.ArrayCreationExpression : Expression {
} }
} }
private int create_sizes_from_initializer_list (SemanticAnalyzer analyzer, InitializerList il, int rank, List<Literal> sl) { private int create_sizes_from_initializer_list (CodeContext context, InitializerList il, int rank, List<Literal> sl) {
if (sl.size == (this.rank - rank)) { if (sl.size == (this.rank - rank)) {
// only add size if this is the first initializer list of the current dimension // only add size if this is the first initializer list of the current dimension
var init = new IntegerLiteral (il.size.to_string (), il.source_reference); var init = new IntegerLiteral (il.size.to_string (), il.source_reference);
init.check (analyzer); init.check (context);
sl.add (init); sl.add (init);
} }
...@@ -145,7 +145,7 @@ public class Vala.ArrayCreationExpression : Expression { ...@@ -145,7 +145,7 @@ public class Vala.ArrayCreationExpression : Expression {
Report.error (e.source_reference, "Expected array element, got array initializer list"); Report.error (e.source_reference, "Expected array element, got array initializer list");
return -1; return -1;
} }
int size = create_sizes_from_initializer_list (analyzer, (InitializerList) e, rank - 1, sl); int size = create_sizes_from_initializer_list (context, (InitializerList) e, rank - 1, sl);
if (size == -1) { if (size == -1) {
return -1; return -1;
} }
...@@ -168,7 +168,7 @@ public class Vala.ArrayCreationExpression : Expression { ...@@ -168,7 +168,7 @@ public class Vala.ArrayCreationExpression : Expression {
return il.size; return il.size;
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (checked) { if (checked) {
return !error; return !error;
} }
...@@ -179,20 +179,20 @@ public class Vala.ArrayCreationExpression : Expression { ...@@ -179,20 +179,20 @@ public class Vala.ArrayCreationExpression : Expression {
var initlist = initializer_list; var initlist = initializer_list;
if (element_type != null) { if (element_type != null) {
element_type.check (analyzer); element_type.check (context);
} }
foreach (Expression e in sizes) { foreach (Expression e in sizes) {
e.check (analyzer); e.check (context);
} }
var calc_sizes = new ArrayList<Literal> (); var calc_sizes = new ArrayList<Literal> ();
if (initlist != null) { if (initlist != null) {
initlist.target_type = new ArrayType (element_type, rank, source_reference); initlist.target_type = new ArrayType (element_type, rank, source_reference);
initlist.check (analyzer); initlist.check (context);
var ret = create_sizes_from_initializer_list (analyzer, initlist, rank, calc_sizes); var ret = create_sizes_from_initializer_list (context, initlist, rank, calc_sizes);
if (ret == -1) { if (ret == -1) {
error = true; error = true;
} }
......
...@@ -236,13 +236,13 @@ public class Vala.ArrayType : ReferenceType { ...@@ -236,13 +236,13 @@ public class Vala.ArrayType : ReferenceType {
return element_type.is_accessible (sym); return element_type.is_accessible (sym);
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (invalid_syntax) { if (invalid_syntax) {
Report.error (source_reference, "syntax error, no expression allowed between array brackets"); Report.error (source_reference, "syntax error, no expression allowed between array brackets");
error = true; error = true;
return false; return false;
} }
return element_type.check (analyzer); return element_type.check (context);
} }
public override string? get_type_id () { public override string? get_type_id () {
......
...@@ -97,7 +97,7 @@ public class Vala.Assignment : Expression { ...@@ -97,7 +97,7 @@ public class Vala.Assignment : Expression {
return false; return false;
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (checked) { if (checked) {
return !error; return !error;
} }
...@@ -109,15 +109,15 @@ public class Vala.Assignment : Expression { ...@@ -109,15 +109,15 @@ public class Vala.Assignment : Expression {
var local = new LocalVariable (null, get_temp_name (), right, right.source_reference); var local = new LocalVariable (null, get_temp_name (), right, right.source_reference);
var decl = new DeclarationStatement (local, source_reference); var decl = new DeclarationStatement (local, source_reference);
decl.check (analyzer); decl.check (context);
insert_statement (analyzer.insert_block, decl); insert_statement (context.analyzer.insert_block, decl);
int i = 0; int i = 0;
ExpressionStatement stmt = null; ExpressionStatement stmt = null;
foreach (var expr in tuple.get_expressions ()) { foreach (var expr in tuple.get_expressions ()) {
if (stmt != null) { if (stmt != null) {
stmt.check (analyzer); stmt.check (context);
insert_statement (analyzer.insert_block, stmt); insert_statement (context.analyzer.insert_block, stmt);
} }
var temp_access = new MemberAccess.simple (local.name, right.source_reference); var temp_access = new MemberAccess.simple (local.name, right.source_reference);
...@@ -129,14 +129,14 @@ public class Vala.Assignment : Expression { ...@@ -129,14 +129,14 @@ public class Vala.Assignment : Expression {
i++; i++;
} }
analyzer.replaced_nodes.add (this); context.analyzer.replaced_nodes.add (this);
parent_node.replace_expression (this, stmt.expression); parent_node.replace_expression (this, stmt.expression);
return stmt.expression.check (analyzer); return stmt.expression.check (context);
} }
left.lvalue = true; left.lvalue = true;
if (!left.check (analyzer)) { if (!left.check (context)) {
// skip on error in inner expression // skip on error in inner expression
error = true; error = true;
return false; return false;
...@@ -146,7 +146,7 @@ public class Vala.Assignment : Expression { ...@@ -146,7 +146,7 @@ public class Vala.Assignment : Expression {
var ma = (MemberAccess) left; var ma = (MemberAccess) left;
if ((!(ma.symbol_reference is Signal || ma.symbol_reference is DynamicProperty) && ma.value_type == null) || if ((!(ma.symbol_reference is Signal || ma.symbol_reference is DynamicProperty) && ma.value_type == null) ||
(ma.inner == null && ma.member_name == "this" && analyzer.is_in_instance_method ())) { (ma.inner == null && ma.member_name == "this" && context.analyzer.is_in_instance_method ())) {
error = true; error = true;
Report.error (source_reference, "unsupported lvalue in assignment"); Report.error (source_reference, "unsupported lvalue in assignment");
return false; return false;
...@@ -165,11 +165,11 @@ public class Vala.Assignment : Expression { ...@@ -165,11 +165,11 @@ public class Vala.Assignment : Expression {
if (ma.symbol_reference is DynamicSignal) { if (ma.symbol_reference is DynamicSignal) {
// target_type not available for dynamic signals // target_type not available for dynamic signals
if (!analyzer.context.deprecated) { if (!context.deprecated) {
Report.warning (source_reference, "deprecated syntax, use `connect' method instead"); Report.warning (source_reference, "deprecated syntax, use `connect' method instead");
} }
} else if (ma.symbol_reference is Signal) { } else if (ma.symbol_reference is Signal) {
if (!analyzer.context.deprecated) { if (!context.deprecated) {
Report.warning (source_reference, "deprecated syntax, use `connect' method instead"); Report.warning (source_reference, "deprecated syntax, use `connect' method instead");
} }
var sig = (Signal) ma.symbol_reference; var sig = (Signal) ma.symbol_reference;
...@@ -181,7 +181,7 @@ public class Vala.Assignment : Expression { ...@@ -181,7 +181,7 @@ public class Vala.Assignment : Expression {
} else if (left is ElementAccess) { } else if (left is ElementAccess) {
var ea = (ElementAccess) left; var ea = (ElementAccess) left;
if (ea.container.value_type.data_type == analyzer.string_type.data_type) { if (ea.container.value_type.data_type == context.analyzer.string_type.data_type) {
error = true; error = true;
Report.error (ea.source_reference, "strings are immutable"); Report.error (ea.source_reference, "strings are immutable");
return false; return false;
...@@ -196,7 +196,7 @@ public class Vala.Assignment : Expression { ...@@ -196,7 +196,7 @@ public class Vala.Assignment : Expression {
} }
set_call.add_argument (right); set_call.add_argument (right);
parent_node.replace_expression (this, set_call); parent_node.replace_expression (this, set_call);
return set_call.check (analyzer); return set_call.check (context);
} else { } else {
right.target_type = left.value_type; right.target_type = left.value_type;
} }
...@@ -208,7 +208,7 @@ public class Vala.Assignment : Expression { ...@@ -208,7 +208,7 @@ public class Vala.Assignment : Expression {
return false; return false;
} }
if (!right.check (analyzer)) { if (!right.check (context)) {
// skip on error in inner expression // skip on error in inner expression
error = true; error = true;
return false; return false;
...@@ -252,7 +252,7 @@ public class Vala.Assignment : Expression { ...@@ -252,7 +252,7 @@ public class Vala.Assignment : Expression {
} }
right = bin; right = bin;
right.check (analyzer); right.check (context);
operator = AssignmentOperator.SIMPLE; operator = AssignmentOperator.SIMPLE;
} }
...@@ -306,14 +306,14 @@ public class Vala.Assignment : Expression { ...@@ -306,14 +306,14 @@ public class Vala.Assignment : Expression {
} }
if (prop.set_accessor == null if (prop.set_accessor == null
|| (!prop.set_accessor.writable && !(analyzer.find_current_method () is CreationMethod || analyzer.is_in_constructor ()))) { || (!prop.set_accessor.writable && !(context.analyzer.find_current_method () is CreationMethod || context.analyzer.is_in_constructor ()))) {
ma.error = true; ma.error = true;
Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ())); Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
return false; return false;
} else if (!analyzer.context.deprecated } else if (!context.deprecated
&& !prop.set_accessor.writable && !prop.set_accessor.writable
&& analyzer.find_current_method () is CreationMethod) { && context.analyzer.find_current_method () is CreationMethod) {
if (ma.inner.symbol_reference != analyzer.find_current_method ().this_parameter) { if (ma.inner.symbol_reference != context.analyzer.find_current_method ().this_parameter) {
// trying to set construct-only property in creation method for foreign instance // trying to set construct-only property in creation method for foreign instance
Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ())); Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
return false; return false;
......
...@@ -49,36 +49,36 @@ public class Vala.BaseAccess : Expression { ...@@ -49,36 +49,36 @@ public class Vala.BaseAccess : Expression {
return true; return true;
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (checked) { if (checked) {
return !error; return !error;
} }
checked = true; checked = true;
if (!analyzer.is_in_instance_method ()) { if (!context.analyzer.is_in_instance_method ()) {
error = true; error = true;
Report.error (source_reference, "Base access invalid outside of instance methods"); Report.error (source_reference, "Base access invalid outside of instance methods");
return false; return false;
} }
if (analyzer.current_class == null) { if (context.analyzer.current_class == null) {
if (analyzer.current_struct == null) { if (context.analyzer.current_struct == null) {
error = true; error = true;
Report.error (source_reference, "Base access invalid outside of class and struct"); Report.error (source_reference, "Base access invalid outside of class and struct");
return false; return false;
} else if (analyzer.current_struct.base_type == null) { } else if (context.analyzer.current_struct.base_type == null) {
error = true; error = true;
Report.error (source_reference, "Base access invalid without base type"); Report.error (source_reference, "Base access invalid without base type");
return false; return false;
} }
value_type = analyzer.current_struct.base_type; value_type = context.analyzer.current_struct.base_type;
} else if (analyzer.current_class.base_class == null) { } else if (context.analyzer.current_class.base_class == null) {
error = true; error = true;
Report.error (source_reference, "Base access invalid without base class"); Report.error (source_reference, "Base access invalid without base class");
return false; return false;
} else { } else {
foreach (var base_type in analyzer.current_class.get_base_types ()) { foreach (var base_type in context.analyzer.current_class.get_base_types ()) {
if (base_type.data_type is Class) { if (base_type.data_type is Class) {
value_type = base_type.copy (); value_type = base_type.copy ();
value_type.value_owned = false; value_type.value_owned = false;
......
...@@ -141,7 +141,7 @@ public class Vala.BinaryExpression : Expression { ...@@ -141,7 +141,7 @@ public class Vala.BinaryExpression : Expression {
return left.is_non_null () && right.is_non_null (); return left.is_non_null () && right.is_non_null ();
} }
public override bool check (SemanticAnalyzer analyzer) { public override bool check (CodeContext context) {
if (checked) { if (checked) {
return !error; return !error;
} }
...@@ -150,14 +150,14 @@ public class Vala.BinaryExpression : Expression { ...@@ -150,14 +150,14 @@ public class Vala.BinaryExpression : Expression {
// some expressions are not in a block, // some expressions are not in a block,
// for example, expressions in method contracts // for example, expressions in method contracts
if (analyzer.current_symbol is Block if (context.analyzer.current_symbol is Block
&& (operator == BinaryOperator.AND || operator == BinaryOperator.OR)) { && (operator == BinaryOperator.AND || operator == BinaryOperator.OR)) {
// convert conditional expression into if statement // convert conditional expression into if statement
// required for flow analysis and exception handling // required for flow analysis and exception handling
var local = new LocalVariable (analyzer.bool_type.copy (), get_temp_name (), null, source_reference); var local = new LocalVariable (context.analyzer.bool_type.copy (), get_temp_name (), null, source_reference);
var decl = new DeclarationStatement (local, source_reference); var decl = new DeclarationStatement (local, source_reference);
decl.check (analyzer); decl.check (context);
var right_stmt = new ExpressionStatement (new Assignment (new MemberAccess.simple (local.name, right.source_reference), right, AssignmentOperator.SIMPLE, right.source_reference), right.source_reference); var right_stmt = new ExpressionStatement (new Assignment (new MemberAccess.simple (local.name, right.source_reference), right, AssignmentOperator.SIMPLE, right.source_reference), right.source_reference);
...@@ -176,17 +176,17 @@ public class Vala.BinaryExpression : Expression { ...@@ -176,17 +176,17 @@ public class Vala.BinaryExpression : Expression {
var if_stmt = new IfStatement (left, true_block, false_block, source_reference); var if_stmt = new IfStatement (left, true_block, false_block, source_reference);
insert_statement (analyzer.insert_block, decl); insert_statement (context.analyzer.insert_block, decl);
insert_statement (analyzer.insert_block, if_stmt); insert_statement (context.analyzer.insert_block, if_stmt);
if (!if_stmt.check (analyzer)) { if (!if_stmt.check (context)) {
error = true; error = true;
return false; return false;
} }
var ma = new MemberAccess.simple (local.name, source_reference); var ma = new MemberAccess.simple (local.name, source_reference);
ma.target_type = target_type; ma.target_type = target_type;
ma.check (analyzer); ma.check (context);
parent_node.replace_expression (this, ma); parent_node.replace_expression (this, ma);
...@@ -196,7 +196,7 @@ public class Vala.BinaryExpression : Expression { ...@@ -196,7 +196,7 @@ public class Vala.BinaryExpression : Expression {
if (operator == BinaryOperator.COALESCE) { if (operator == BinaryOperator.COALESCE) {
var local = new LocalVariable (null, get_temp_name (), left, source_reference); var local = new LocalVariable (null, get_temp_name (), left, source_reference);
var decl = new DeclarationStatement (local, source_reference); var decl = new DeclarationStatement (local, source_reference);
decl.check (analyzer); decl.check (context);
var right_stmt = new ExpressionStatement (new Assignment (new MemberAccess.simple (local.name, right.source_reference), right, AssignmentOperator.SIMPLE, right.source_reference), right.source_reference); var right_stmt = new ExpressionStatement (new Assignment (new MemberAccess.simple (local.name, right.source_reference), right, AssignmentOperator.SIMPLE, right.source_reference), right.source_reference);
...@@ -208,24 +208,24 @@ public class Vala.BinaryExpression : Expression { ...@@ -208,24 +208,24 @@ public class Vala.BinaryExpression : Expression {
var if_stmt = new IfStatement (cond, true_block, null, source_reference); var if_stmt = new IfStatement (cond, true_block, null, source_reference);
insert_statement (analyzer.insert_block, decl); insert_statement (context.analyzer.insert_block, decl);
insert_statement (analyzer.insert_block, if_stmt); insert_statement (context.analyzer.insert_block, if_stmt);
if (!if_stmt.check (analyzer)) { if (!if_stmt.check (context)) {
error = true; error = true;
return false; return false;
} }
var ma = new MemberAccess.simple (local.name, source_reference); var ma = new MemberAccess.simple (local.name, source_reference);
ma.target_type = target_type; ma.target_type = target_type;
ma.check (analyzer); ma.check (context);
parent_node.replace_expression (this, ma); parent_node.replace_expression (this, ma);
return true; return true;
} }
if (!left.check (analyzer) || !right.check (analyzer)) { if (!left.check (context) || !right.check (context)) {
/* if there were any errors in inner expressions, skip type check */ /* if there were any errors in inner expressions, skip type check */
error = true; error = true;
return false; return false;
...@@ -243,31 +243,31 @@ public class Vala.BinaryExpression : Expression { ...@@ -243,31 +243,31 @@ public class Vala.BinaryExpression : Expression {
return false; return false;
} }
if (left.value_type.data_type == analyzer.string_type.data_type if (left.value_type.data_type == context.analyzer.string_type.data_type
&& operator == BinaryOperator.PLUS) { && operator == BinaryOperator.PLUS) {
// string concatenation // string concatenation
if (analyzer.context.profile == Profile.DOVA) { if (context.profile == Profile.DOVA) {
var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference); var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference);
concat_call.add_argument (right); concat_call.add_argument (right);
concat_call.target_type = target_type; concat_call.target_type = target_type;
parent_node.replace_expression (this, concat_call); parent_node.replace_expression (this, concat_call);
return concat_call.check (analyzer); return concat_call.check (context);
} }
if (right.value_type == null || right.value_type.data_type != analyzer.string_type.data_type) { if (right.value_type == null || right.value_type.data_type != context.analyzer.string_type.data_type) {
error = true; error = true;
Report.error (source_reference, "Operands must be strings"); Report.error (source_reference, "Operands must be strings");
return false; return false;
} }
value_type = analyzer.string_type.copy (); value_type = context.analyzer.string_type.copy ();
if (left.is_constant () && right.is_constant ()) { if (left.is_constant () && right.is_constant ()) {
value_type.value_owned = false; value_type.value_owned = false;
} else { } else {
value_type.value_owned = true; value_type.value_owned = true;
} }
} else if (analyzer.context.profile == Profile.DOVA && left.value_type.data_type == analyzer.list_type.data_type } else if (context.profile == Profile.DOVA && left.value_type.data_type == context.analyzer.list_type.data_type
&& operator == BinaryOperator.PLUS) { && operator == BinaryOperator.PLUS) {
// list concatenation // list concatenation
...@@ -275,8 +275,8 @@ public class Vala.BinaryExpression : Expression { ...@@ -275,8 +275,8 @@ public class Vala.BinaryExpression : Expression {
concat_call.add_argument (right); concat_call.add_argument (right);
concat_call.target_type = target_type; concat_call.target_type = target_type;
parent_node.replace_expression (this, concat_call); parent_node.replace_expression (this, concat_call);
return concat_call.check (analyzer); return concat_call.check (context);
} else if (analyzer.context.profile != Profile.DOVA && left.value_type is ArrayType && operator == BinaryOperator.PLUS) { } else if (context.profile != Profile.DOVA && left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
// array concatenation // array concatenation
var array_type = (ArrayType) left.value_type; var array_type = (ArrayType) left.value_type;
...@@ -313,16 +313,16 @@ public class Vala.BinaryExpression : Expression { ...@@ -313,16 +313,16 @@ public class Vala.BinaryExpression : Expression {
} }
} else if (right.value_type is PointerType) { } else if (right.value_type is PointerType) {
// pointer arithmetic: pointer - pointer // pointer arithmetic: pointer - pointer
if (analyzer.context.profile == Profile.DOVA) { if (context.profile == Profile.DOVA) {
value_type = analyzer.long_type; value_type = context.analyzer.long_type;
} else { } else {
value_type = analyzer.size_t_type; value_type = context.analyzer.size_t_type;
} }
} }
} }
if (value_type == null) { if (value_type == null) {
value_type = analyzer.get_arithmetic_result_type (left.value_type, right.value_type); value_type = context.analyzer.get_arithmetic_result_type (left.value_type, right.value_type);
} }
if (value_type == null) { if (value_type == null) {
...@@ -334,7 +334,7 @@ public class Vala.BinaryExpression : Expression { ...@@ -334,7 +334,7 @@ public class Vala.BinaryExpression : Expression {
|| operator == BinaryOperator.SHIFT_LEFT || operator == BinaryOperator.SHIFT_LEFT
|| operator == BinaryOperator.SHIFT_RIGHT || operator == BinaryOperator.SHIFT_RIGHT
|| operator == BinaryOperator.BITWISE_XOR) { || operator == BinaryOperator.BITWISE_XOR) {
value_type = analyzer.get_arithmetic_result_type (left.value_type, right.value_type); value_type = context.analyzer.get_arithmetic_result_type (left.value_type, right.value_type);
if (value_type == null) { if (value_type == null) {
error = true; error = true;
...@@ -345,8 +345,8 @@ public class Vala.BinaryExpression : Expression { ...@@ -345,8 +345,8 @@ public class Vala.BinaryExpression : Expression {
|| operator == BinaryOperator.GREATER_THAN || operator == BinaryOperator.GREATER_THAN
|| operator == BinaryOperator.LESS_THAN_OR_EQUAL || operator == BinaryOperator.LESS_THAN_OR_EQUAL
|| operator == BinaryOperator.GREATER_THAN_OR_EQUAL) { || operator == BinaryOperator.GREATER_THAN_OR_EQUAL) {
if (left.value_type.compatible (analyzer.string_type) if (left.value_type.compatible (context.analyzer.string_type)
&& right.value_type.compatible (analyzer.string_type)) { && right.value_type.compatible (context.analyzer.string_type)) {
// string comparison // string comparison
} else if (left.value_type is PointerType && right.value_type is PointerType) { } else if (left.value_type is PointerType && right.value_type is PointerType) {
// pointer arithmetic // pointer arithmetic
...@@ -355,9 +355,9 @@ public class Vala.BinaryExpression : Expression { ...@@ -355,9 +355,9 @@ public class Vala.BinaryExpression : Expression {
if (chained) { if (chained) {
var lbe = (BinaryExpression) left; var lbe = (BinaryExpression) left;
resulting_type = analyzer.get_arithmetic_result_type (lbe.right.value_type, right.value_type); resulting_type = context.analyzer.get_arithmetic_result_type (lbe.right.value_type, right.value_type);
} else { } else {
resulting_type = analyzer.get_arithmetic_result_type (left.value_type, right.value_type); resulting_type = context.analyzer.get_arithmetic_result_type (left.value_type, right.value_type);
} }
if (resulting_type == null) { if (resulting_type == null) {
...@@ -374,7 +374,7 @@ public class Vala.BinaryExpression : Expression { ...@@ -374,7 +374,7 @@ public class Vala.BinaryExpression : Expression {
right.target_type.value_owned = false; right.target_type.value_owned = false;
} }
value_type = analyzer.bool_type; value_type = context.analyzer.bool_type;
} else if (operator == BinaryOperator.EQUALITY } else if (operator == BinaryOperator.EQUALITY
|| operator == BinaryOperator.INEQUALITY) { || operator == BinaryOperator.INEQUALITY) {
/* relational operation */ /* relational operation */
...@@ -400,10 +400,10 @@ public class Vala.BinaryExpression : Expression { ...@@ -400,10 +400,10 @@ public class Vala.BinaryExpression : Expression {
} }
} }
if (left.value_type.compatible (analyzer.string_type) if (left.value_type.compatible (context.analyzer.string_type)
&& right.value_type.compatible (analyzer.string_type)) { && right.value_type.compatible (context.