~ubuntu-branches/ubuntu/natty/vala/natty

« back to all changes in this revision

Viewing changes to vala/valaparameter.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-01-06 10:31:36 UTC
  • mfrom: (1.5.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110106103136-e08fwvpxpqhz3rv0
Tags: 0.11.3-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
961
961
        ValaSymbol* _tmp13_ = NULL;
962
962
        ValaDataType* _tmp14_ = NULL;
963
963
        ValaExpression* _tmp28_ = NULL;
964
 
        ValaSemanticAnalyzer* _tmp52_ = NULL;
965
 
        ValaSemanticAnalyzer* _tmp53_ = NULL;
966
 
        gboolean _tmp54_;
 
964
        ValaSemanticAnalyzer* _tmp56_ = NULL;
 
965
        ValaSemanticAnalyzer* _tmp57_ = NULL;
 
966
        gboolean _tmp58_;
967
967
        self = (ValaParameter*) base;
968
968
        g_return_val_if_fail (context != NULL, FALSE);
969
969
        _tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
1090
1090
                        vala_report_warning (_tmp34_, _tmp39_);
1091
1091
                        _g_free0 (_tmp39_);
1092
1092
                        _g_free0 (_tmp37_);
 
1093
                } else {
 
1094
                        gboolean _tmp40_ = FALSE;
 
1095
                        ValaExpression* _tmp41_ = NULL;
 
1096
                        _tmp41_ = vala_variable_get_initializer ((ValaVariable*) self);
 
1097
                        if (!VALA_IS_NULL_LITERAL (_tmp41_)) {
 
1098
                                _tmp40_ = self->priv->_direction == VALA_PARAMETER_DIRECTION_OUT;
 
1099
                        } else {
 
1100
                                _tmp40_ = FALSE;
 
1101
                        }
 
1102
                        if (_tmp40_) {
 
1103
                                ValaSourceReference* _tmp42_ = NULL;
 
1104
                                _tmp42_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
 
1105
                                vala_report_error (_tmp42_, "only `null' is allowed as default value for out parameters");
 
1106
                        } else {
 
1107
                                if (self->priv->_direction == VALA_PARAMETER_DIRECTION_REF) {
 
1108
                                        ValaSourceReference* _tmp43_ = NULL;
 
1109
                                        _tmp43_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
 
1110
                                        vala_report_error (_tmp43_, "default value not allowed for ref parameter");
 
1111
                                }
 
1112
                        }
1093
1113
                }
1094
1114
        }
1095
1115
        if (!self->priv->_ellipsis) {
1096
 
                ValaSemanticAnalyzer* _tmp40_ = NULL;
1097
 
                ValaDataType* _tmp41_ = NULL;
1098
 
                gboolean _tmp42_;
1099
 
                _tmp40_ = vala_code_context_get_analyzer (context);
1100
 
                _tmp41_ = vala_variable_get_variable_type ((ValaVariable*) self);
1101
 
                _tmp42_ = vala_semantic_analyzer_is_type_accessible (_tmp40_, (ValaSymbol*) self, _tmp41_);
1102
 
                if (!_tmp42_) {
1103
 
                        ValaSourceReference* _tmp43_ = NULL;
1104
 
                        ValaDataType* _tmp44_ = NULL;
1105
 
                        gchar* _tmp45_ = NULL;
1106
 
                        gchar* _tmp46_;
1107
 
                        ValaSymbol* _tmp47_ = NULL;
1108
 
                        gchar* _tmp48_ = NULL;
1109
 
                        gchar* _tmp49_;
1110
 
                        gchar* _tmp50_ = NULL;
1111
 
                        gchar* _tmp51_;
 
1116
                ValaSemanticAnalyzer* _tmp44_ = NULL;
 
1117
                ValaDataType* _tmp45_ = NULL;
 
1118
                gboolean _tmp46_;
 
1119
                _tmp44_ = vala_code_context_get_analyzer (context);
 
1120
                _tmp45_ = vala_variable_get_variable_type ((ValaVariable*) self);
 
1121
                _tmp46_ = vala_semantic_analyzer_is_type_accessible (_tmp44_, (ValaSymbol*) self, _tmp45_);
 
1122
                if (!_tmp46_) {
 
1123
                        ValaSourceReference* _tmp47_ = NULL;
 
1124
                        ValaDataType* _tmp48_ = NULL;
 
1125
                        gchar* _tmp49_ = NULL;
 
1126
                        gchar* _tmp50_;
 
1127
                        ValaSymbol* _tmp51_ = NULL;
 
1128
                        gchar* _tmp52_ = NULL;
 
1129
                        gchar* _tmp53_;
 
1130
                        gchar* _tmp54_ = NULL;
 
1131
                        gchar* _tmp55_;
1112
1132
                        vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
1113
 
                        _tmp43_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
1114
 
                        _tmp44_ = vala_variable_get_variable_type ((ValaVariable*) self);
1115
 
                        _tmp45_ = vala_code_node_to_string ((ValaCodeNode*) _tmp44_);
1116
 
                        _tmp46_ = _tmp45_;
1117
 
                        _tmp47_ = vala_symbol_get_parent_symbol ((ValaSymbol*) self);
1118
 
                        _tmp48_ = vala_symbol_get_full_name (_tmp47_);
1119
 
                        _tmp49_ = _tmp48_;
1120
 
                        _tmp50_ = g_strdup_printf ("parameter type `%s` is less accessible than method `%s`", _tmp46_, _tmp49_);
1121
 
                        _tmp51_ = _tmp50_;
1122
 
                        vala_report_error (_tmp43_, _tmp51_);
1123
 
                        _g_free0 (_tmp51_);
1124
 
                        _g_free0 (_tmp49_);
1125
 
                        _g_free0 (_tmp46_);
 
1133
                        _tmp47_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
 
1134
                        _tmp48_ = vala_variable_get_variable_type ((ValaVariable*) self);
 
1135
                        _tmp49_ = vala_code_node_to_string ((ValaCodeNode*) _tmp48_);
 
1136
                        _tmp50_ = _tmp49_;
 
1137
                        _tmp51_ = vala_symbol_get_parent_symbol ((ValaSymbol*) self);
 
1138
                        _tmp52_ = vala_symbol_get_full_name (_tmp51_);
 
1139
                        _tmp53_ = _tmp52_;
 
1140
                        _tmp54_ = g_strdup_printf ("parameter type `%s` is less accessible than method `%s`", _tmp50_, _tmp53_);
 
1141
                        _tmp55_ = _tmp54_;
 
1142
                        vala_report_error (_tmp47_, _tmp55_);
 
1143
                        _g_free0 (_tmp55_);
 
1144
                        _g_free0 (_tmp53_);
 
1145
                        _g_free0 (_tmp50_);
1126
1146
                }
1127
1147
        }
1128
 
        _tmp52_ = vala_code_context_get_analyzer (context);
1129
 
        vala_semantic_analyzer_set_current_source_file (_tmp52_, old_source_file);
1130
 
        _tmp53_ = vala_code_context_get_analyzer (context);
1131
 
        vala_semantic_analyzer_set_current_symbol (_tmp53_, old_symbol);
1132
 
        _tmp54_ = vala_code_node_get_error ((ValaCodeNode*) self);
1133
 
        result = !_tmp54_;
 
1148
        _tmp56_ = vala_code_context_get_analyzer (context);
 
1149
        vala_semantic_analyzer_set_current_source_file (_tmp56_, old_source_file);
 
1150
        _tmp57_ = vala_code_context_get_analyzer (context);
 
1151
        vala_semantic_analyzer_set_current_symbol (_tmp57_, old_symbol);
 
1152
        _tmp58_ = vala_code_node_get_error ((ValaCodeNode*) self);
 
1153
        result = !_tmp58_;
1134
1154
        _vala_code_node_unref0 (old_symbol);
1135
1155
        _vala_source_file_unref0 (old_source_file);
1136
1156
        return result;