~ubuntu-branches/ubuntu/maverick/vala/maverick

« back to all changes in this revision

Viewing changes to vala/valabinaryexpression.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-02-13 17:59:22 UTC
  • mfrom: (7.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100213175922-n8bq2xv2q1hihhqb
Tags: 0.7.10-1ubuntu1
* Sync with Debian unstable.
* Remaining changes :
 - debian/rules: Don't make unit test failures fatal to fix FTBFS. It was
   needed if vala need to enter main but it's not the case for now. 
   (See #374151)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
/* valabinaryexpression.vala
5
5
 *
6
 
 * Copyright (C) 2006-2009  Jürg Billeter
 
6
 * Copyright (C) 2006-2010  Jürg Billeter
7
7
 *
8
8
 * This library is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU Lesser General Public
698
698
typedef struct _ValaStringLiteral ValaStringLiteral;
699
699
typedef struct _ValaStringLiteralClass ValaStringLiteralClass;
700
700
 
 
701
#define VALA_TYPE_TEMPLATE (vala_template_get_type ())
 
702
#define VALA_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TEMPLATE, ValaTemplate))
 
703
#define VALA_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TEMPLATE, ValaTemplateClass))
 
704
#define VALA_IS_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TEMPLATE))
 
705
#define VALA_IS_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TEMPLATE))
 
706
#define VALA_TEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TEMPLATE, ValaTemplateClass))
 
707
 
 
708
typedef struct _ValaTemplate ValaTemplate;
 
709
typedef struct _ValaTemplateClass ValaTemplateClass;
 
710
 
701
711
#define VALA_TYPE_NULL_LITERAL (vala_null_literal_get_type ())
702
712
#define VALA_NULL_LITERAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_NULL_LITERAL, ValaNullLiteral))
703
713
#define VALA_NULL_LITERAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_NULL_LITERAL, ValaNullLiteralClass))
1012
1022
        VALA_BINARY_OPERATOR_BITWISE_XOR,
1013
1023
        VALA_BINARY_OPERATOR_AND,
1014
1024
        VALA_BINARY_OPERATOR_OR,
1015
 
        VALA_BINARY_OPERATOR_IN
 
1025
        VALA_BINARY_OPERATOR_IN,
 
1026
        VALA_BINARY_OPERATOR_COALESCE
1016
1027
} ValaBinaryOperator;
1017
1028
 
1018
1029
struct _ValaBinaryExpressionPrivate {
1085
1096
        void (*visit_integer_literal) (ValaCodeVisitor* self, ValaIntegerLiteral* lit);
1086
1097
        void (*visit_real_literal) (ValaCodeVisitor* self, ValaRealLiteral* lit);
1087
1098
        void (*visit_string_literal) (ValaCodeVisitor* self, ValaStringLiteral* lit);
 
1099
        void (*visit_template) (ValaCodeVisitor* self, ValaTemplate* tmpl);
1088
1100
        void (*visit_null_literal) (ValaCodeVisitor* self, ValaNullLiteral* lit);
1089
1101
        void (*visit_member_access) (ValaCodeVisitor* self, ValaMemberAccess* expr);
1090
1102
        void (*visit_method_call) (ValaCodeVisitor* self, ValaMethodCall* expr);
1290
1302
GType vala_integer_literal_get_type (void);
1291
1303
GType vala_real_literal_get_type (void);
1292
1304
GType vala_string_literal_get_type (void);
 
1305
GType vala_template_get_type (void);
1293
1306
GType vala_null_literal_get_type (void);
1294
1307
GType vala_member_access_get_type (void);
1295
1308
GType vala_element_access_get_type (void);
1340
1353
ValaDataType* vala_expression_get_target_type (ValaExpression* self);
1341
1354
void vala_expression_set_target_type (ValaExpression* self, ValaDataType* value);
1342
1355
void vala_code_node_replace_expression (ValaCodeNode* self, ValaExpression* old_node, ValaExpression* new_node);
 
1356
ValaNullLiteral* vala_null_literal_new (ValaSourceReference* source);
 
1357
ValaNullLiteral* vala_null_literal_construct (GType object_type, ValaSourceReference* source);
1343
1358
ValaDataType* vala_expression_get_value_type (ValaExpression* self);
1344
1359
void vala_report_error (ValaSourceReference* source, const char* message);
1345
1360
ValaTypeSymbol* vala_data_type_get_data_type (ValaDataType* self);
1352
1367
GType vala_pointer_type_get_type (void);
1353
1368
gboolean vala_struct_is_integer_type (ValaStruct* self);
1354
1369
ValaDataType* vala_semantic_analyzer_get_arithmetic_result_type (ValaSemanticAnalyzer* self, ValaDataType* left_type, ValaDataType* right_type);
 
1370
void vala_data_type_set_nullable (ValaDataType* self, gboolean value);
 
1371
gboolean vala_data_type_get_nullable (ValaDataType* self);
1355
1372
ValaSymbol* vala_data_type_get_member (ValaDataType* self, const char* member_name);
1356
1373
ValaList* vala_method_get_parameters (ValaMethod* self);
1357
1374
char* vala_symbol_get_full_name (ValaSymbol* self);
1520
1537
                        result = g_strdup ("in");
1521
1538
                        return result;
1522
1539
                }
 
1540
                case VALA_BINARY_OPERATOR_COALESCE:
 
1541
                {
 
1542
                        result = g_strdup ("??");
 
1543
                        return result;
 
1544
                }
1523
1545
        }
1524
1546
        g_assert_not_reached ();
1525
1547
}
1624
1646
        gboolean result;
1625
1647
        gboolean _tmp0_ = FALSE;
1626
1648
        gboolean _tmp1_ = FALSE;
1627
 
        gboolean _tmp13_ = FALSE;
1628
 
        gboolean _tmp14_ = FALSE;
1629
 
        gboolean _tmp15_ = FALSE;
 
1649
        gboolean _tmp21_ = FALSE;
 
1650
        gboolean _tmp22_ = FALSE;
 
1651
        gboolean _tmp23_ = FALSE;
1630
1652
        self = (ValaBinaryExpression*) base;
1631
1653
        g_return_val_if_fail (analyzer != NULL, FALSE);
1632
1654
        if (vala_code_node_get_checked ((ValaCodeNode*) self)) {
1713
1735
                _vala_code_node_unref0 (ma);
1714
1736
                return result;
1715
1737
        }
 
1738
        if (self->priv->_operator == VALA_BINARY_OPERATOR_COALESCE) {
 
1739
                char* _tmp13_;
 
1740
                ValaLocalVariable* _tmp14_;
 
1741
                ValaLocalVariable* local;
 
1742
                ValaDeclarationStatement* decl;
 
1743
                ValaAssignment* _tmp16_;
 
1744
                ValaMemberAccess* _tmp15_;
 
1745
                ValaExpressionStatement* _tmp17_;
 
1746
                ValaExpressionStatement* right_stmt;
 
1747
                ValaBlock* true_block;
 
1748
                ValaNullLiteral* _tmp19_;
 
1749
                ValaMemberAccess* _tmp18_;
 
1750
                ValaBinaryExpression* _tmp20_;
 
1751
                ValaBinaryExpression* cond;
 
1752
                ValaIfStatement* if_stmt;
 
1753
                ValaMemberAccess* ma;
 
1754
                local = (_tmp14_ = vala_local_variable_new (NULL, _tmp13_ = vala_code_node_get_temp_name ((ValaCodeNode*) self), vala_binary_expression_get_left (self), vala_code_node_get_source_reference ((ValaCodeNode*) self)), _g_free0 (_tmp13_), _tmp14_);
 
1755
                decl = vala_declaration_statement_new ((ValaSymbol*) local, vala_code_node_get_source_reference ((ValaCodeNode*) self));
 
1756
                vala_code_node_check ((ValaCodeNode*) decl, analyzer);
 
1757
                right_stmt = (_tmp17_ = vala_expression_statement_new ((ValaExpression*) (_tmp16_ = vala_assignment_new ((ValaExpression*) (_tmp15_ = vala_member_access_new_simple (vala_symbol_get_name ((ValaSymbol*) local), vala_code_node_get_source_reference ((ValaCodeNode*) vala_binary_expression_get_right (self)))), vala_binary_expression_get_right (self), VALA_ASSIGNMENT_OPERATOR_SIMPLE, vala_code_node_get_source_reference ((ValaCodeNode*) vala_binary_expression_get_right (self)))), vala_code_node_get_source_reference ((ValaCodeNode*) vala_binary_expression_get_right (self))), _vala_code_node_unref0 (_tmp16_), _vala_code_node_unref0 (_tmp15_), _tmp17_);
 
1758
                true_block = vala_block_new (vala_code_node_get_source_reference ((ValaCodeNode*) self));
 
1759
                vala_block_add_statement (true_block, (ValaStatement*) right_stmt);
 
1760
                cond = (_tmp20_ = vala_binary_expression_new (VALA_BINARY_OPERATOR_EQUALITY, (ValaExpression*) (_tmp18_ = vala_member_access_new_simple (vala_symbol_get_name ((ValaSymbol*) local), vala_code_node_get_source_reference ((ValaCodeNode*) vala_binary_expression_get_left (self)))), (ValaExpression*) (_tmp19_ = vala_null_literal_new (vala_code_node_get_source_reference ((ValaCodeNode*) self))), vala_code_node_get_source_reference ((ValaCodeNode*) self)), _vala_code_node_unref0 (_tmp19_), _vala_code_node_unref0 (_tmp18_), _tmp20_);
 
1761
                if_stmt = vala_if_statement_new ((ValaExpression*) cond, true_block, NULL, vala_code_node_get_source_reference ((ValaCodeNode*) self));
 
1762
                vala_expression_insert_statement ((ValaExpression*) self, analyzer->insert_block, (ValaStatement*) decl);
 
1763
                vala_expression_insert_statement ((ValaExpression*) self, analyzer->insert_block, (ValaStatement*) if_stmt);
 
1764
                if (!vala_code_node_check ((ValaCodeNode*) if_stmt, analyzer)) {
 
1765
                        vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
 
1766
                        result = FALSE;
 
1767
                        _vala_code_node_unref0 (local);
 
1768
                        _vala_code_node_unref0 (decl);
 
1769
                        _vala_code_node_unref0 (right_stmt);
 
1770
                        _vala_code_node_unref0 (true_block);
 
1771
                        _vala_code_node_unref0 (cond);
 
1772
                        _vala_code_node_unref0 (if_stmt);
 
1773
                        return result;
 
1774
                }
 
1775
                ma = vala_member_access_new_simple (vala_symbol_get_name ((ValaSymbol*) local), vala_code_node_get_source_reference ((ValaCodeNode*) self));
 
1776
                vala_expression_set_target_type ((ValaExpression*) ma, vala_expression_get_target_type ((ValaExpression*) self));
 
1777
                vala_code_node_check ((ValaCodeNode*) ma, analyzer);
 
1778
                vala_code_node_replace_expression (vala_code_node_get_parent_node ((ValaCodeNode*) self), (ValaExpression*) self, (ValaExpression*) ma);
 
1779
                result = TRUE;
 
1780
                _vala_code_node_unref0 (local);
 
1781
                _vala_code_node_unref0 (decl);
 
1782
                _vala_code_node_unref0 (right_stmt);
 
1783
                _vala_code_node_unref0 (true_block);
 
1784
                _vala_code_node_unref0 (cond);
 
1785
                _vala_code_node_unref0 (if_stmt);
 
1786
                _vala_code_node_unref0 (ma);
 
1787
                return result;
 
1788
        }
1716
1789
        if (!vala_code_node_check ((ValaCodeNode*) vala_binary_expression_get_left (self), analyzer)) {
1717
 
                _tmp13_ = TRUE;
 
1790
                _tmp21_ = TRUE;
1718
1791
        } else {
1719
 
                _tmp13_ = !vala_code_node_check ((ValaCodeNode*) vala_binary_expression_get_right (self), analyzer);
 
1792
                _tmp21_ = !vala_code_node_check ((ValaCodeNode*) vala_binary_expression_get_right (self), analyzer);
1720
1793
        }
1721
 
        if (_tmp13_) {
 
1794
        if (_tmp21_) {
1722
1795
                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1723
1796
                result = FALSE;
1724
1797
                return result;
1730
1803
                return result;
1731
1804
        }
1732
1805
        if (self->priv->_operator != VALA_BINARY_OPERATOR_IN) {
1733
 
                _tmp14_ = vala_expression_get_value_type (vala_binary_expression_get_right (self)) == NULL;
 
1806
                _tmp22_ = vala_expression_get_value_type (vala_binary_expression_get_right (self)) == NULL;
1734
1807
        } else {
1735
 
                _tmp14_ = FALSE;
 
1808
                _tmp22_ = FALSE;
1736
1809
        }
1737
 
        if (_tmp14_) {
 
1810
        if (_tmp22_) {
1738
1811
                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) vala_binary_expression_get_right (self)), "invalid right operand");
1739
1812
                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1740
1813
                result = FALSE;
1741
1814
                return result;
1742
1815
        }
1743
1816
        if (vala_data_type_get_data_type (vala_expression_get_value_type (vala_binary_expression_get_left (self))) == vala_data_type_get_data_type (analyzer->string_type)) {
1744
 
                _tmp15_ = self->priv->_operator == VALA_BINARY_OPERATOR_PLUS;
 
1817
                _tmp23_ = self->priv->_operator == VALA_BINARY_OPERATOR_PLUS;
1745
1818
        } else {
1746
 
                _tmp15_ = FALSE;
 
1819
                _tmp23_ = FALSE;
1747
1820
        }
1748
 
        if (_tmp15_) {
1749
 
                gboolean _tmp16_ = FALSE;
1750
 
                ValaDataType* _tmp17_;
1751
 
                gboolean _tmp18_ = FALSE;
 
1821
        if (_tmp23_) {
 
1822
                gboolean _tmp24_ = FALSE;
 
1823
                ValaDataType* _tmp25_;
 
1824
                gboolean _tmp26_ = FALSE;
1752
1825
                if (vala_expression_get_value_type (vala_binary_expression_get_right (self)) == NULL) {
1753
 
                        _tmp16_ = TRUE;
 
1826
                        _tmp24_ = TRUE;
1754
1827
                } else {
1755
 
                        _tmp16_ = vala_data_type_get_data_type (vala_expression_get_value_type (vala_binary_expression_get_right (self))) != vala_data_type_get_data_type (analyzer->string_type);
 
1828
                        _tmp24_ = vala_data_type_get_data_type (vala_expression_get_value_type (vala_binary_expression_get_right (self))) != vala_data_type_get_data_type (analyzer->string_type);
1756
1829
                }
1757
 
                if (_tmp16_) {
 
1830
                if (_tmp24_) {
1758
1831
                        vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1759
1832
                        vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), "Operands must be strings");
1760
1833
                        result = FALSE;
1761
1834
                        return result;
1762
1835
                }
1763
 
                vala_expression_set_value_type ((ValaExpression*) self, _tmp17_ = vala_data_type_copy (analyzer->string_type));
1764
 
                _vala_code_node_unref0 (_tmp17_);
 
1836
                vala_expression_set_value_type ((ValaExpression*) self, _tmp25_ = vala_data_type_copy (analyzer->string_type));
 
1837
                _vala_code_node_unref0 (_tmp25_);
1765
1838
                if (vala_expression_is_constant (vala_binary_expression_get_left (self))) {
1766
 
                        _tmp18_ = vala_expression_is_constant (vala_binary_expression_get_right (self));
 
1839
                        _tmp26_ = vala_expression_is_constant (vala_binary_expression_get_right (self));
1767
1840
                } else {
1768
 
                        _tmp18_ = FALSE;
 
1841
                        _tmp26_ = FALSE;
1769
1842
                }
1770
 
                if (_tmp18_) {
 
1843
                if (_tmp26_) {
1771
1844
                        vala_data_type_set_value_owned (vala_expression_get_value_type ((ValaExpression*) self), FALSE);
1772
1845
                } else {
1773
1846
                        vala_data_type_set_value_owned (vala_expression_get_value_type ((ValaExpression*) self), TRUE);
1774
1847
                }
1775
1848
        } else {
1776
 
                gboolean _tmp19_ = FALSE;
 
1849
                gboolean _tmp27_ = FALSE;
1777
1850
                if (VALA_IS_ARRAY_TYPE (vala_expression_get_value_type (vala_binary_expression_get_left (self)))) {
1778
 
                        _tmp19_ = self->priv->_operator == VALA_BINARY_OPERATOR_PLUS;
 
1851
                        _tmp27_ = self->priv->_operator == VALA_BINARY_OPERATOR_PLUS;
1779
1852
                } else {
1780
 
                        _tmp19_ = FALSE;
 
1853
                        _tmp27_ = FALSE;
1781
1854
                }
1782
 
                if (_tmp19_) {
 
1855
                if (_tmp27_) {
1783
1856
                        ValaArrayType* array_type;
1784
 
                        gboolean _tmp20_ = FALSE;
1785
 
                        ValaDataType* _tmp21_;
 
1857
                        gboolean _tmp28_ = FALSE;
 
1858
                        ValaDataType* _tmp29_;
1786
1859
                        array_type = _vala_code_node_ref0 (VALA_ARRAY_TYPE (vala_expression_get_value_type (vala_binary_expression_get_left (self))));
1787
1860
                        if (vala_expression_get_value_type (vala_binary_expression_get_right (self)) == NULL) {
1788
 
                                _tmp20_ = TRUE;
 
1861
                                _tmp28_ = TRUE;
1789
1862
                        } else {
1790
 
                                _tmp20_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), vala_array_type_get_element_type (array_type));
 
1863
                                _tmp28_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), vala_array_type_get_element_type (array_type));
1791
1864
                        }
1792
 
                        if (_tmp20_) {
 
1865
                        if (_tmp28_) {
1793
1866
                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1794
1867
                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), "Incompatible operand");
1795
1868
                                result = FALSE;
1796
1869
                                _vala_code_node_unref0 (array_type);
1797
1870
                                return result;
1798
1871
                        }
1799
 
                        vala_expression_set_value_type ((ValaExpression*) self, _tmp21_ = vala_data_type_copy ((ValaDataType*) array_type));
1800
 
                        _vala_code_node_unref0 (_tmp21_);
 
1872
                        vala_expression_set_value_type ((ValaExpression*) self, _tmp29_ = vala_data_type_copy ((ValaDataType*) array_type));
 
1873
                        _vala_code_node_unref0 (_tmp29_);
1801
1874
                        vala_data_type_set_value_owned (vala_expression_get_value_type ((ValaExpression*) self), TRUE);
1802
1875
                        _vala_code_node_unref0 (array_type);
1803
1876
                } else {
1804
 
                        gboolean _tmp22_ = FALSE;
1805
 
                        gboolean _tmp23_ = FALSE;
1806
 
                        gboolean _tmp24_ = FALSE;
 
1877
                        gboolean _tmp30_ = FALSE;
 
1878
                        gboolean _tmp31_ = FALSE;
 
1879
                        gboolean _tmp32_ = FALSE;
1807
1880
                        if (self->priv->_operator == VALA_BINARY_OPERATOR_PLUS) {
1808
 
                                _tmp24_ = TRUE;
1809
 
                        } else {
1810
 
                                _tmp24_ = self->priv->_operator == VALA_BINARY_OPERATOR_MINUS;
1811
 
                        }
1812
 
                        if (_tmp24_) {
1813
 
                                _tmp23_ = TRUE;
1814
 
                        } else {
1815
 
                                _tmp23_ = self->priv->_operator == VALA_BINARY_OPERATOR_MUL;
1816
 
                        }
1817
 
                        if (_tmp23_) {
1818
 
                                _tmp22_ = TRUE;
1819
 
                        } else {
1820
 
                                _tmp22_ = self->priv->_operator == VALA_BINARY_OPERATOR_DIV;
1821
 
                        }
1822
 
                        if (_tmp22_) {
 
1881
                                _tmp32_ = TRUE;
 
1882
                        } else {
 
1883
                                _tmp32_ = self->priv->_operator == VALA_BINARY_OPERATOR_MINUS;
 
1884
                        }
 
1885
                        if (_tmp32_) {
 
1886
                                _tmp31_ = TRUE;
 
1887
                        } else {
 
1888
                                _tmp31_ = self->priv->_operator == VALA_BINARY_OPERATOR_MUL;
 
1889
                        }
 
1890
                        if (_tmp31_) {
 
1891
                                _tmp30_ = TRUE;
 
1892
                        } else {
 
1893
                                _tmp30_ = self->priv->_operator == VALA_BINARY_OPERATOR_DIV;
 
1894
                        }
 
1895
                        if (_tmp30_) {
1823
1896
                                if (VALA_IS_POINTER_TYPE (vala_expression_get_value_type (vala_binary_expression_get_left (self)))) {
1824
 
                                        ValaTypeSymbol* _tmp25_;
 
1897
                                        ValaTypeSymbol* _tmp33_;
1825
1898
                                        ValaStruct* offset_type;
1826
 
                                        gboolean _tmp26_ = FALSE;
1827
 
                                        offset_type = _vala_code_node_ref0 ((_tmp25_ = vala_data_type_get_data_type (vala_expression_get_value_type (vala_binary_expression_get_right (self))), VALA_IS_STRUCT (_tmp25_) ? ((ValaStruct*) _tmp25_) : NULL));
 
1899
                                        gboolean _tmp34_ = FALSE;
 
1900
                                        offset_type = _vala_code_node_ref0 ((_tmp33_ = vala_data_type_get_data_type (vala_expression_get_value_type (vala_binary_expression_get_right (self))), VALA_IS_STRUCT (_tmp33_) ? ((ValaStruct*) _tmp33_) : NULL));
1828
1901
                                        if (offset_type != NULL) {
1829
 
                                                _tmp26_ = vala_struct_is_integer_type (offset_type);
 
1902
                                                _tmp34_ = vala_struct_is_integer_type (offset_type);
1830
1903
                                        } else {
1831
 
                                                _tmp26_ = FALSE;
 
1904
                                                _tmp34_ = FALSE;
1832
1905
                                        }
1833
 
                                        if (_tmp26_) {
1834
 
                                                gboolean _tmp27_ = FALSE;
 
1906
                                        if (_tmp34_) {
 
1907
                                                gboolean _tmp35_ = FALSE;
1835
1908
                                                if (self->priv->_operator == VALA_BINARY_OPERATOR_PLUS) {
1836
 
                                                        _tmp27_ = TRUE;
 
1909
                                                        _tmp35_ = TRUE;
1837
1910
                                                } else {
1838
 
                                                        _tmp27_ = self->priv->_operator == VALA_BINARY_OPERATOR_MINUS;
 
1911
                                                        _tmp35_ = self->priv->_operator == VALA_BINARY_OPERATOR_MINUS;
1839
1912
                                                }
1840
 
                                                if (_tmp27_) {
1841
 
                                                        ValaDataType* _tmp28_;
1842
 
                                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp28_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_left (self))));
1843
 
                                                        _vala_code_node_unref0 (_tmp28_);
 
1913
                                                if (_tmp35_) {
 
1914
                                                        ValaDataType* _tmp36_;
 
1915
                                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp36_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_left (self))));
 
1916
                                                        _vala_code_node_unref0 (_tmp36_);
1844
1917
                                                }
1845
1918
                                        } else {
1846
1919
                                                if (VALA_IS_POINTER_TYPE (vala_expression_get_value_type (vala_binary_expression_get_right (self)))) {
1850
1923
                                        _vala_code_node_unref0 (offset_type);
1851
1924
                                }
1852
1925
                                if (vala_expression_get_value_type ((ValaExpression*) self) == NULL) {
1853
 
                                        ValaDataType* _tmp29_;
1854
 
                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp29_ = vala_semantic_analyzer_get_arithmetic_result_type (analyzer, vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self))));
1855
 
                                        _vala_code_node_unref0 (_tmp29_);
 
1926
                                        ValaDataType* _tmp37_;
 
1927
                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp37_ = vala_semantic_analyzer_get_arithmetic_result_type (analyzer, vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self))));
 
1928
                                        _vala_code_node_unref0 (_tmp37_);
1856
1929
                                }
1857
1930
                                if (vala_expression_get_value_type ((ValaExpression*) self) == NULL) {
1858
 
                                        char* _tmp32_;
1859
 
                                        char* _tmp31_;
1860
 
                                        char* _tmp30_;
 
1931
                                        char* _tmp40_;
 
1932
                                        char* _tmp39_;
 
1933
                                        char* _tmp38_;
1861
1934
                                        vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1862
 
                                        vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp32_ = g_strdup_printf ("Arithmetic operation not supported for types `%s' and `%s'", _tmp30_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp31_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
1863
 
                                        _g_free0 (_tmp32_);
1864
 
                                        _g_free0 (_tmp31_);
1865
 
                                        _g_free0 (_tmp30_);
 
1935
                                        vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp40_ = g_strdup_printf ("Arithmetic operation not supported for types `%s' and `%s'", _tmp38_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp39_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
 
1936
                                        _g_free0 (_tmp40_);
 
1937
                                        _g_free0 (_tmp39_);
 
1938
                                        _g_free0 (_tmp38_);
1866
1939
                                        result = FALSE;
1867
1940
                                        return result;
1868
1941
                                }
1869
1942
                        } else {
1870
 
                                gboolean _tmp33_ = FALSE;
1871
 
                                gboolean _tmp34_ = FALSE;
1872
 
                                gboolean _tmp35_ = FALSE;
 
1943
                                gboolean _tmp41_ = FALSE;
 
1944
                                gboolean _tmp42_ = FALSE;
 
1945
                                gboolean _tmp43_ = FALSE;
1873
1946
                                if (self->priv->_operator == VALA_BINARY_OPERATOR_MOD) {
1874
 
                                        _tmp35_ = TRUE;
1875
 
                                } else {
1876
 
                                        _tmp35_ = self->priv->_operator == VALA_BINARY_OPERATOR_SHIFT_LEFT;
1877
 
                                }
1878
 
                                if (_tmp35_) {
1879
 
                                        _tmp34_ = TRUE;
1880
 
                                } else {
1881
 
                                        _tmp34_ = self->priv->_operator == VALA_BINARY_OPERATOR_SHIFT_RIGHT;
1882
 
                                }
1883
 
                                if (_tmp34_) {
1884
 
                                        _tmp33_ = TRUE;
1885
 
                                } else {
1886
 
                                        _tmp33_ = self->priv->_operator == VALA_BINARY_OPERATOR_BITWISE_XOR;
1887
 
                                }
1888
 
                                if (_tmp33_) {
1889
 
                                        ValaDataType* _tmp36_;
1890
 
                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp36_ = vala_semantic_analyzer_get_arithmetic_result_type (analyzer, vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self))));
1891
 
                                        _vala_code_node_unref0 (_tmp36_);
 
1947
                                        _tmp43_ = TRUE;
 
1948
                                } else {
 
1949
                                        _tmp43_ = self->priv->_operator == VALA_BINARY_OPERATOR_SHIFT_LEFT;
 
1950
                                }
 
1951
                                if (_tmp43_) {
 
1952
                                        _tmp42_ = TRUE;
 
1953
                                } else {
 
1954
                                        _tmp42_ = self->priv->_operator == VALA_BINARY_OPERATOR_SHIFT_RIGHT;
 
1955
                                }
 
1956
                                if (_tmp42_) {
 
1957
                                        _tmp41_ = TRUE;
 
1958
                                } else {
 
1959
                                        _tmp41_ = self->priv->_operator == VALA_BINARY_OPERATOR_BITWISE_XOR;
 
1960
                                }
 
1961
                                if (_tmp41_) {
 
1962
                                        ValaDataType* _tmp44_;
 
1963
                                        vala_expression_set_value_type ((ValaExpression*) self, _tmp44_ = vala_semantic_analyzer_get_arithmetic_result_type (analyzer, vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self))));
 
1964
                                        _vala_code_node_unref0 (_tmp44_);
1892
1965
                                        if (vala_expression_get_value_type ((ValaExpression*) self) == NULL) {
1893
 
                                                char* _tmp39_;
1894
 
                                                char* _tmp38_;
1895
 
                                                char* _tmp37_;
 
1966
                                                char* _tmp47_;
 
1967
                                                char* _tmp46_;
 
1968
                                                char* _tmp45_;
1896
1969
                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1897
 
                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp39_ = g_strdup_printf ("Arithmetic operation not supported for types `%s' and `%s'", _tmp37_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp38_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
1898
 
                                                _g_free0 (_tmp39_);
1899
 
                                                _g_free0 (_tmp38_);
1900
 
                                                _g_free0 (_tmp37_);
 
1970
                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp47_ = g_strdup_printf ("Arithmetic operation not supported for types `%s' and `%s'", _tmp45_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp46_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
 
1971
                                                _g_free0 (_tmp47_);
 
1972
                                                _g_free0 (_tmp46_);
 
1973
                                                _g_free0 (_tmp45_);
1901
1974
                                                result = FALSE;
1902
1975
                                                return result;
1903
1976
                                        }
1904
1977
                                } else {
1905
 
                                        gboolean _tmp40_ = FALSE;
1906
 
                                        gboolean _tmp41_ = FALSE;
1907
 
                                        gboolean _tmp42_ = FALSE;
 
1978
                                        gboolean _tmp48_ = FALSE;
 
1979
                                        gboolean _tmp49_ = FALSE;
 
1980
                                        gboolean _tmp50_ = FALSE;
1908
1981
                                        if (self->priv->_operator == VALA_BINARY_OPERATOR_LESS_THAN) {
1909
 
                                                _tmp42_ = TRUE;
1910
 
                                        } else {
1911
 
                                                _tmp42_ = self->priv->_operator == VALA_BINARY_OPERATOR_GREATER_THAN;
1912
 
                                        }
1913
 
                                        if (_tmp42_) {
1914
 
                                                _tmp41_ = TRUE;
1915
 
                                        } else {
1916
 
                                                _tmp41_ = self->priv->_operator == VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL;
1917
 
                                        }
1918
 
                                        if (_tmp41_) {
1919
 
                                                _tmp40_ = TRUE;
1920
 
                                        } else {
1921
 
                                                _tmp40_ = self->priv->_operator == VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL;
1922
 
                                        }
1923
 
                                        if (_tmp40_) {
1924
 
                                                gboolean _tmp43_ = FALSE;
 
1982
                                                _tmp50_ = TRUE;
 
1983
                                        } else {
 
1984
                                                _tmp50_ = self->priv->_operator == VALA_BINARY_OPERATOR_GREATER_THAN;
 
1985
                                        }
 
1986
                                        if (_tmp50_) {
 
1987
                                                _tmp49_ = TRUE;
 
1988
                                        } else {
 
1989
                                                _tmp49_ = self->priv->_operator == VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL;
 
1990
                                        }
 
1991
                                        if (_tmp49_) {
 
1992
                                                _tmp48_ = TRUE;
 
1993
                                        } else {
 
1994
                                                _tmp48_ = self->priv->_operator == VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL;
 
1995
                                        }
 
1996
                                        if (_tmp48_) {
 
1997
                                                gboolean _tmp51_ = FALSE;
1925
1998
                                                if (vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), analyzer->string_type)) {
1926
 
                                                        _tmp43_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->string_type);
 
1999
                                                        _tmp51_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->string_type);
1927
2000
                                                } else {
1928
 
                                                        _tmp43_ = FALSE;
 
2001
                                                        _tmp51_ = FALSE;
1929
2002
                                                }
1930
 
                                                if (_tmp43_) {
 
2003
                                                if (_tmp51_) {
1931
2004
                                                } else {
1932
 
                                                        gboolean _tmp44_ = FALSE;
 
2005
                                                        gboolean _tmp52_ = FALSE;
1933
2006
                                                        if (VALA_IS_POINTER_TYPE (vala_expression_get_value_type (vala_binary_expression_get_left (self)))) {
1934
 
                                                                _tmp44_ = VALA_IS_POINTER_TYPE (vala_expression_get_value_type (vala_binary_expression_get_right (self)));
 
2007
                                                                _tmp52_ = VALA_IS_POINTER_TYPE (vala_expression_get_value_type (vala_binary_expression_get_right (self)));
1935
2008
                                                        } else {
1936
 
                                                                _tmp44_ = FALSE;
 
2009
                                                                _tmp52_ = FALSE;
1937
2010
                                                        }
1938
 
                                                        if (_tmp44_) {
 
2011
                                                        if (_tmp52_) {
1939
2012
                                                        } else {
1940
2013
                                                                ValaDataType* resulting_type;
 
2014
                                                                ValaDataType* _tmp56_;
 
2015
                                                                ValaDataType* _tmp57_;
1941
2016
                                                                resulting_type = vala_semantic_analyzer_get_arithmetic_result_type (analyzer, vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self)));
1942
2017
                                                                if (resulting_type == NULL) {
1943
 
                                                                        char* _tmp47_;
1944
 
                                                                        char* _tmp46_;
1945
 
                                                                        char* _tmp45_;
 
2018
                                                                        char* _tmp55_;
 
2019
                                                                        char* _tmp54_;
 
2020
                                                                        char* _tmp53_;
1946
2021
                                                                        vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1947
 
                                                                        vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp47_ = g_strdup_printf ("Relational operation not supported for types `%s' and `%s'", _tmp45_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp46_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
1948
 
                                                                        _g_free0 (_tmp47_);
1949
 
                                                                        _g_free0 (_tmp46_);
1950
 
                                                                        _g_free0 (_tmp45_);
 
2022
                                                                        vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp55_ = g_strdup_printf ("Relational operation not supported for types `%s' and `%s'", _tmp53_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self))), _tmp54_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
 
2023
                                                                        _g_free0 (_tmp55_);
 
2024
                                                                        _g_free0 (_tmp54_);
 
2025
                                                                        _g_free0 (_tmp53_);
1951
2026
                                                                        result = FALSE;
1952
2027
                                                                        _vala_code_node_unref0 (resulting_type);
1953
2028
                                                                        return result;
1954
2029
                                                                }
 
2030
                                                                vala_expression_set_target_type (vala_binary_expression_get_left (self), _tmp56_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_left (self))));
 
2031
                                                                _vala_code_node_unref0 (_tmp56_);
 
2032
                                                                vala_data_type_set_nullable (vala_expression_get_target_type (vala_binary_expression_get_left (self)), FALSE);
 
2033
                                                                vala_data_type_set_value_owned (vala_expression_get_target_type (vala_binary_expression_get_left (self)), FALSE);
 
2034
                                                                vala_expression_set_target_type (vala_binary_expression_get_right (self), _tmp57_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_right (self))));
 
2035
                                                                _vala_code_node_unref0 (_tmp57_);
 
2036
                                                                vala_data_type_set_nullable (vala_expression_get_target_type (vala_binary_expression_get_right (self)), FALSE);
 
2037
                                                                vala_data_type_set_value_owned (vala_expression_get_target_type (vala_binary_expression_get_right (self)), FALSE);
1955
2038
                                                                _vala_code_node_unref0 (resulting_type);
1956
2039
                                                        }
1957
2040
                                                }
1958
2041
                                                vala_expression_set_value_type ((ValaExpression*) self, analyzer->bool_type);
1959
2042
                                        } else {
1960
 
                                                gboolean _tmp48_ = FALSE;
 
2043
                                                gboolean _tmp58_ = FALSE;
1961
2044
                                                if (self->priv->_operator == VALA_BINARY_OPERATOR_EQUALITY) {
1962
 
                                                        _tmp48_ = TRUE;
 
2045
                                                        _tmp58_ = TRUE;
1963
2046
                                                } else {
1964
 
                                                        _tmp48_ = self->priv->_operator == VALA_BINARY_OPERATOR_INEQUALITY;
 
2047
                                                        _tmp58_ = self->priv->_operator == VALA_BINARY_OPERATOR_INEQUALITY;
1965
2048
                                                }
1966
 
                                                if (_tmp48_) {
1967
 
                                                        gboolean _tmp49_ = FALSE;
1968
 
                                                        gboolean _tmp53_ = FALSE;
 
2049
                                                if (_tmp58_) {
 
2050
                                                        gboolean _tmp59_ = FALSE;
 
2051
                                                        ValaDataType* _tmp63_;
 
2052
                                                        ValaDataType* _tmp64_;
 
2053
                                                        gboolean _tmp65_ = FALSE;
1969
2054
                                                        if (!vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), vala_expression_get_value_type (vala_binary_expression_get_left (self)))) {
1970
 
                                                                _tmp49_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self)));
 
2055
                                                                _tmp59_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), vala_expression_get_value_type (vala_binary_expression_get_right (self)));
1971
2056
                                                        } else {
1972
 
                                                                _tmp49_ = FALSE;
 
2057
                                                                _tmp59_ = FALSE;
1973
2058
                                                        }
1974
 
                                                        if (_tmp49_) {
1975
 
                                                                char* _tmp52_;
1976
 
                                                                char* _tmp51_;
1977
 
                                                                char* _tmp50_;
1978
 
                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp52_ = g_strdup_printf ("Equality operation: `%s' and `%s' are incompatible", _tmp50_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self))), _tmp51_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self)))));
1979
 
                                                                _g_free0 (_tmp52_);
1980
 
                                                                _g_free0 (_tmp51_);
1981
 
                                                                _g_free0 (_tmp50_);
 
2059
                                                        if (_tmp59_) {
 
2060
                                                                char* _tmp62_;
 
2061
                                                                char* _tmp61_;
 
2062
                                                                char* _tmp60_;
 
2063
                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp62_ = g_strdup_printf ("Equality operation: `%s' and `%s' are incompatible", _tmp60_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self))), _tmp61_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_left (self)))));
 
2064
                                                                _g_free0 (_tmp62_);
 
2065
                                                                _g_free0 (_tmp61_);
 
2066
                                                                _g_free0 (_tmp60_);
1982
2067
                                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1983
2068
                                                                result = FALSE;
1984
2069
                                                                return result;
1985
2070
                                                        }
 
2071
                                                        vala_expression_set_target_type (vala_binary_expression_get_left (self), _tmp63_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_left (self))));
 
2072
                                                        _vala_code_node_unref0 (_tmp63_);
 
2073
                                                        vala_data_type_set_value_owned (vala_expression_get_target_type (vala_binary_expression_get_left (self)), FALSE);
 
2074
                                                        vala_expression_set_target_type (vala_binary_expression_get_right (self), _tmp64_ = vala_data_type_copy (vala_expression_get_value_type (vala_binary_expression_get_right (self))));
 
2075
                                                        _vala_code_node_unref0 (_tmp64_);
 
2076
                                                        vala_data_type_set_value_owned (vala_expression_get_target_type (vala_binary_expression_get_right (self)), FALSE);
 
2077
                                                        if (vala_data_type_get_nullable (vala_expression_get_value_type (vala_binary_expression_get_left (self))) != vala_data_type_get_nullable (vala_expression_get_value_type (vala_binary_expression_get_right (self)))) {
 
2078
                                                                if (!vala_data_type_get_nullable (vala_expression_get_value_type (vala_binary_expression_get_left (self)))) {
 
2079
                                                                        vala_data_type_set_nullable (vala_expression_get_target_type (vala_binary_expression_get_left (self)), TRUE);
 
2080
                                                                } else {
 
2081
                                                                        if (!vala_data_type_get_nullable (vala_expression_get_value_type (vala_binary_expression_get_right (self)))) {
 
2082
                                                                                vala_data_type_set_nullable (vala_expression_get_target_type (vala_binary_expression_get_right (self)), TRUE);
 
2083
                                                                        }
 
2084
                                                                }
 
2085
                                                        }
1986
2086
                                                        if (vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), analyzer->string_type)) {
1987
 
                                                                _tmp53_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->string_type);
 
2087
                                                                _tmp65_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->string_type);
1988
2088
                                                        } else {
1989
 
                                                                _tmp53_ = FALSE;
 
2089
                                                                _tmp65_ = FALSE;
1990
2090
                                                        }
1991
 
                                                        if (_tmp53_) {
 
2091
                                                        if (_tmp65_) {
1992
2092
                                                        }
1993
2093
                                                        vala_expression_set_value_type ((ValaExpression*) self, analyzer->bool_type);
1994
2094
                                                } else {
1995
 
                                                        gboolean _tmp54_ = FALSE;
 
2095
                                                        gboolean _tmp66_ = FALSE;
1996
2096
                                                        if (self->priv->_operator == VALA_BINARY_OPERATOR_BITWISE_AND) {
1997
 
                                                                _tmp54_ = TRUE;
 
2097
                                                                _tmp66_ = TRUE;
1998
2098
                                                        } else {
1999
 
                                                                _tmp54_ = self->priv->_operator == VALA_BINARY_OPERATOR_BITWISE_OR;
 
2099
                                                                _tmp66_ = self->priv->_operator == VALA_BINARY_OPERATOR_BITWISE_OR;
2000
2100
                                                        }
2001
 
                                                        if (_tmp54_) {
 
2101
                                                        if (_tmp66_) {
2002
2102
                                                                vala_expression_set_value_type ((ValaExpression*) self, vala_expression_get_value_type (vala_binary_expression_get_left (self)));
2003
2103
                                                        } else {
2004
 
                                                                gboolean _tmp55_ = FALSE;
 
2104
                                                                gboolean _tmp67_ = FALSE;
2005
2105
                                                                if (self->priv->_operator == VALA_BINARY_OPERATOR_AND) {
2006
 
                                                                        _tmp55_ = TRUE;
 
2106
                                                                        _tmp67_ = TRUE;
2007
2107
                                                                } else {
2008
 
                                                                        _tmp55_ = self->priv->_operator == VALA_BINARY_OPERATOR_OR;
 
2108
                                                                        _tmp67_ = self->priv->_operator == VALA_BINARY_OPERATOR_OR;
2009
2109
                                                                }
2010
 
                                                                if (_tmp55_) {
2011
 
                                                                        gboolean _tmp56_ = FALSE;
 
2110
                                                                if (_tmp67_) {
 
2111
                                                                        gboolean _tmp68_ = FALSE;
2012
2112
                                                                        if (!vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), analyzer->bool_type)) {
2013
 
                                                                                _tmp56_ = TRUE;
 
2113
                                                                                _tmp68_ = TRUE;
2014
2114
                                                                        } else {
2015
 
                                                                                _tmp56_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->bool_type);
 
2115
                                                                                _tmp68_ = !vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->bool_type);
2016
2116
                                                                        }
2017
 
                                                                        if (_tmp56_) {
 
2117
                                                                        if (_tmp68_) {
2018
2118
                                                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
2019
2119
                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), "Operands must be boolean");
2020
2120
                                                                        }
2021
2121
                                                                        vala_expression_set_value_type ((ValaExpression*) self, analyzer->bool_type);
2022
2122
                                                                } else {
2023
2123
                                                                        if (self->priv->_operator == VALA_BINARY_OPERATOR_IN) {
2024
 
                                                                                gboolean _tmp57_ = FALSE;
 
2124
                                                                                gboolean _tmp69_ = FALSE;
2025
2125
                                                                                if (vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_left (self)), analyzer->int_type)) {
2026
 
                                                                                        _tmp57_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->int_type);
 
2126
                                                                                        _tmp69_ = vala_data_type_compatible (vala_expression_get_value_type (vala_binary_expression_get_right (self)), analyzer->int_type);
2027
2127
                                                                                } else {
2028
 
                                                                                        _tmp57_ = FALSE;
 
2128
                                                                                        _tmp69_ = FALSE;
2029
2129
                                                                                }
2030
 
                                                                                if (_tmp57_) {
 
2130
                                                                                if (_tmp69_) {
2031
2131
                                                                                } else {
2032
 
                                                                                        ValaSymbol* _tmp58_;
 
2132
                                                                                        ValaSymbol* _tmp70_;
2033
2133
                                                                                        ValaMethod* contains_method;
2034
 
                                                                                        ValaList* _tmp61_;
2035
 
                                                                                        gboolean _tmp62_;
2036
 
                                                                                        ValaMemberAccess* _tmp67_;
2037
 
                                                                                        ValaMethodCall* _tmp68_;
 
2134
                                                                                        ValaList* _tmp73_;
 
2135
                                                                                        gboolean _tmp74_;
 
2136
                                                                                        ValaMemberAccess* _tmp79_;
 
2137
                                                                                        ValaMethodCall* _tmp80_;
2038
2138
                                                                                        ValaMethodCall* contains_call;
2039
 
                                                                                        contains_method = (_tmp58_ = vala_data_type_get_member (vala_expression_get_value_type (vala_binary_expression_get_right (self)), "contains"), VALA_IS_METHOD (_tmp58_) ? ((ValaMethod*) _tmp58_) : NULL);
 
2139
                                                                                        contains_method = (_tmp70_ = vala_data_type_get_member (vala_expression_get_value_type (vala_binary_expression_get_right (self)), "contains"), VALA_IS_METHOD (_tmp70_) ? ((ValaMethod*) _tmp70_) : NULL);
2040
2140
                                                                                        if (contains_method == NULL) {
2041
 
                                                                                                char* _tmp60_;
2042
 
                                                                                                char* _tmp59_;
2043
 
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp60_ = g_strdup_printf ("`%s' does not have a `contains' method", _tmp59_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
2044
 
                                                                                                _g_free0 (_tmp60_);
2045
 
                                                                                                _g_free0 (_tmp59_);
 
2141
                                                                                                char* _tmp72_;
 
2142
                                                                                                char* _tmp71_;
 
2143
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp72_ = g_strdup_printf ("`%s' does not have a `contains' method", _tmp71_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (vala_binary_expression_get_right (self)))));
 
2144
                                                                                                _g_free0 (_tmp72_);
 
2145
                                                                                                _g_free0 (_tmp71_);
2046
2146
                                                                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
2047
2147
                                                                                                result = FALSE;
2048
2148
                                                                                                _vala_code_node_unref0 (contains_method);
2049
2149
                                                                                                return result;
2050
2150
                                                                                        }
2051
 
                                                                                        if ((_tmp62_ = vala_collection_get_size ((ValaCollection*) (_tmp61_ = vala_method_get_parameters (contains_method))) != 1, _vala_collection_object_unref0 (_tmp61_), _tmp62_)) {
2052
 
                                                                                                char* _tmp64_;
2053
 
                                                                                                char* _tmp63_;
2054
 
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp64_ = g_strdup_printf ("`%s' must have one parameter", _tmp63_ = vala_symbol_get_full_name ((ValaSymbol*) contains_method)));
2055
 
                                                                                                _g_free0 (_tmp64_);
2056
 
                                                                                                _g_free0 (_tmp63_);
 
2151
                                                                                        if ((_tmp74_ = vala_collection_get_size ((ValaCollection*) (_tmp73_ = vala_method_get_parameters (contains_method))) != 1, _vala_collection_object_unref0 (_tmp73_), _tmp74_)) {
 
2152
                                                                                                char* _tmp76_;
 
2153
                                                                                                char* _tmp75_;
 
2154
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp76_ = g_strdup_printf ("`%s' must have one parameter", _tmp75_ = vala_symbol_get_full_name ((ValaSymbol*) contains_method)));
 
2155
                                                                                                _g_free0 (_tmp76_);
 
2156
                                                                                                _g_free0 (_tmp75_);
2057
2157
                                                                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
2058
2158
                                                                                                result = FALSE;
2059
2159
                                                                                                _vala_code_node_unref0 (contains_method);
2060
2160
                                                                                                return result;
2061
2161
                                                                                        }
2062
2162
                                                                                        if (!vala_data_type_compatible (vala_method_get_return_type (contains_method), analyzer->bool_type)) {
2063
 
                                                                                                char* _tmp66_;
2064
 
                                                                                                char* _tmp65_;
2065
 
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp66_ = g_strdup_printf ("`%s' must return a boolean value", _tmp65_ = vala_symbol_get_full_name ((ValaSymbol*) contains_method)));
2066
 
                                                                                                _g_free0 (_tmp66_);
2067
 
                                                                                                _g_free0 (_tmp65_);
 
2163
                                                                                                char* _tmp78_;
 
2164
                                                                                                char* _tmp77_;
 
2165
                                                                                                vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self), _tmp78_ = g_strdup_printf ("`%s' must return a boolean value", _tmp77_ = vala_symbol_get_full_name ((ValaSymbol*) contains_method)));
 
2166
                                                                                                _g_free0 (_tmp78_);
 
2167
                                                                                                _g_free0 (_tmp77_);
2068
2168
                                                                                                vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
2069
2169
                                                                                                result = FALSE;
2070
2170
                                                                                                _vala_code_node_unref0 (contains_method);
2071
2171
                                                                                                return result;
2072
2172
                                                                                        }
2073
 
                                                                                        contains_call = (_tmp68_ = vala_method_call_new ((ValaExpression*) (_tmp67_ = vala_member_access_new (vala_binary_expression_get_right (self), "contains", NULL)), NULL), _vala_code_node_unref0 (_tmp67_), _tmp68_);
 
2173
                                                                                        contains_call = (_tmp80_ = vala_method_call_new ((ValaExpression*) (_tmp79_ = vala_member_access_new (vala_binary_expression_get_right (self), "contains", NULL)), NULL), _vala_code_node_unref0 (_tmp79_), _tmp80_);
2074
2174
                                                                                        vala_method_call_add_argument (contains_call, vala_binary_expression_get_left (self));
2075
2175
                                                                                        vala_code_node_replace_expression (vala_code_node_get_parent_node ((ValaCodeNode*) self), (ValaExpression*) self, (ValaExpression*) contains_call);
2076
2176
                                                                                        result = vala_code_node_check ((ValaCodeNode*) contains_call, analyzer);
2204
2304
GType vala_binary_operator_get_type (void) {
2205
2305
        static GType vala_binary_operator_type_id = 0;
2206
2306
        if (G_UNLIKELY (vala_binary_operator_type_id == 0)) {
2207
 
                static const GEnumValue values[] = {{VALA_BINARY_OPERATOR_NONE, "VALA_BINARY_OPERATOR_NONE", "none"}, {VALA_BINARY_OPERATOR_PLUS, "VALA_BINARY_OPERATOR_PLUS", "plus"}, {VALA_BINARY_OPERATOR_MINUS, "VALA_BINARY_OPERATOR_MINUS", "minus"}, {VALA_BINARY_OPERATOR_MUL, "VALA_BINARY_OPERATOR_MUL", "mul"}, {VALA_BINARY_OPERATOR_DIV, "VALA_BINARY_OPERATOR_DIV", "div"}, {VALA_BINARY_OPERATOR_MOD, "VALA_BINARY_OPERATOR_MOD", "mod"}, {VALA_BINARY_OPERATOR_SHIFT_LEFT, "VALA_BINARY_OPERATOR_SHIFT_LEFT", "shift-left"}, {VALA_BINARY_OPERATOR_SHIFT_RIGHT, "VALA_BINARY_OPERATOR_SHIFT_RIGHT", "shift-right"}, {VALA_BINARY_OPERATOR_LESS_THAN, "VALA_BINARY_OPERATOR_LESS_THAN", "less-than"}, {VALA_BINARY_OPERATOR_GREATER_THAN, "VALA_BINARY_OPERATOR_GREATER_THAN", "greater-than"}, {VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL, "VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL", "less-than-or-equal"}, {VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL, "VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL", "greater-than-or-equal"}, {VALA_BINARY_OPERATOR_EQUALITY, "VALA_BINARY_OPERATOR_EQUALITY", "equality"}, {VALA_BINARY_OPERATOR_INEQUALITY, "VALA_BINARY_OPERATOR_INEQUALITY", "inequality"}, {VALA_BINARY_OPERATOR_BITWISE_AND, "VALA_BINARY_OPERATOR_BITWISE_AND", "bitwise-and"}, {VALA_BINARY_OPERATOR_BITWISE_OR, "VALA_BINARY_OPERATOR_BITWISE_OR", "bitwise-or"}, {VALA_BINARY_OPERATOR_BITWISE_XOR, "VALA_BINARY_OPERATOR_BITWISE_XOR", "bitwise-xor"}, {VALA_BINARY_OPERATOR_AND, "VALA_BINARY_OPERATOR_AND", "and"}, {VALA_BINARY_OPERATOR_OR, "VALA_BINARY_OPERATOR_OR", "or"}, {VALA_BINARY_OPERATOR_IN, "VALA_BINARY_OPERATOR_IN", "in"}, {0, NULL, NULL}};
 
2307
                static const GEnumValue values[] = {{VALA_BINARY_OPERATOR_NONE, "VALA_BINARY_OPERATOR_NONE", "none"}, {VALA_BINARY_OPERATOR_PLUS, "VALA_BINARY_OPERATOR_PLUS", "plus"}, {VALA_BINARY_OPERATOR_MINUS, "VALA_BINARY_OPERATOR_MINUS", "minus"}, {VALA_BINARY_OPERATOR_MUL, "VALA_BINARY_OPERATOR_MUL", "mul"}, {VALA_BINARY_OPERATOR_DIV, "VALA_BINARY_OPERATOR_DIV", "div"}, {VALA_BINARY_OPERATOR_MOD, "VALA_BINARY_OPERATOR_MOD", "mod"}, {VALA_BINARY_OPERATOR_SHIFT_LEFT, "VALA_BINARY_OPERATOR_SHIFT_LEFT", "shift-left"}, {VALA_BINARY_OPERATOR_SHIFT_RIGHT, "VALA_BINARY_OPERATOR_SHIFT_RIGHT", "shift-right"}, {VALA_BINARY_OPERATOR_LESS_THAN, "VALA_BINARY_OPERATOR_LESS_THAN", "less-than"}, {VALA_BINARY_OPERATOR_GREATER_THAN, "VALA_BINARY_OPERATOR_GREATER_THAN", "greater-than"}, {VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL, "VALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL", "less-than-or-equal"}, {VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL, "VALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL", "greater-than-or-equal"}, {VALA_BINARY_OPERATOR_EQUALITY, "VALA_BINARY_OPERATOR_EQUALITY", "equality"}, {VALA_BINARY_OPERATOR_INEQUALITY, "VALA_BINARY_OPERATOR_INEQUALITY", "inequality"}, {VALA_BINARY_OPERATOR_BITWISE_AND, "VALA_BINARY_OPERATOR_BITWISE_AND", "bitwise-and"}, {VALA_BINARY_OPERATOR_BITWISE_OR, "VALA_BINARY_OPERATOR_BITWISE_OR", "bitwise-or"}, {VALA_BINARY_OPERATOR_BITWISE_XOR, "VALA_BINARY_OPERATOR_BITWISE_XOR", "bitwise-xor"}, {VALA_BINARY_OPERATOR_AND, "VALA_BINARY_OPERATOR_AND", "and"}, {VALA_BINARY_OPERATOR_OR, "VALA_BINARY_OPERATOR_OR", "or"}, {VALA_BINARY_OPERATOR_IN, "VALA_BINARY_OPERATOR_IN", "in"}, {VALA_BINARY_OPERATOR_COALESCE, "VALA_BINARY_OPERATOR_COALESCE", "coalesce"}, {0, NULL, NULL}};
2208
2308
                vala_binary_operator_type_id = g_enum_register_static ("ValaBinaryOperator", values);
2209
2309
        }
2210
2310
        return vala_binary_operator_type_id;