@@ -122,7 +122,6 @@ def validate_class_module_definition
122122 entry . each_decl do |decl |
123123 if super_class = decl . super_class
124124 super_class . args . each do |arg |
125- no_self_type_validator ( arg )
126125 no_classish_type_validator ( arg )
127126 @validator . validate_type ( arg , context : nil )
128127 end
@@ -132,7 +131,6 @@ def validate_class_module_definition
132131 entry . each_decl do |decl |
133132 decl . self_types . each do |self_type |
134133 self_type . args . each do |arg |
135- no_self_type_validator ( arg )
136134 no_classish_type_validator ( arg )
137135 @validator . validate_type ( arg , context : nil )
138136 end
@@ -161,19 +159,16 @@ def validate_class_module_definition
161159
162160 d . type_params . each do |param |
163161 if ub = param . upper_bound_type
164- no_self_type_validator ( ub )
165162 no_classish_type_validator ( ub )
166163 @validator . validate_type ( ub , context : nil )
167164 end
168165
169166 if lb = param . lower_bound_type
170- no_self_type_validator ( lb )
171167 no_classish_type_validator ( lb )
172168 @validator . validate_type ( lb , context : nil )
173169 end
174170
175171 if dt = param . default_type
176- no_self_type_validator ( dt )
177172 no_classish_type_validator ( dt )
178173 @validator . validate_type ( dt , context : nil )
179174 end
@@ -189,9 +184,6 @@ def validate_class_module_definition
189184 when AST ::Members ::MethodDefinition
190185 @validator . validate_method_definition ( member , type_name : name )
191186 when AST ::Members ::Mixin
192- member . args . each do |arg |
193- no_self_type_validator ( arg )
194- end
195187 params =
196188 if member . name . class?
197189 module_decl = @env . normalized_module_entry ( member . name ) or raise
@@ -203,9 +195,6 @@ def validate_class_module_definition
203195 InvalidTypeApplicationError . check! ( type_name : member . name , params : params , args : member . args , location : member . location )
204196 when AST ::Members ::Var
205197 @validator . validate_variable ( member )
206- if member . is_a? ( AST ::Members ::ClassVariable )
207- no_self_type_validator ( member . type )
208- end
209198 end
210199 end
211200 else
@@ -241,19 +230,16 @@ def validate_interface
241230
242231 decl . decl . type_params . each do |param |
243232 if ub = param . upper_bound_type
244- no_self_type_validator ( ub )
245233 no_classish_type_validator ( ub )
246234 @validator . validate_type ( ub , context : nil )
247235 end
248236
249237 if lb = param . lower_bound_type
250- no_self_type_validator ( lb )
251238 no_classish_type_validator ( lb )
252239 @validator . validate_type ( lb , context : nil )
253240 end
254241
255242 if dt = param . default_type
256- no_self_type_validator ( dt )
257243 no_classish_type_validator ( dt )
258244 @validator . validate_type ( dt , context : nil )
259245 end
@@ -280,7 +266,6 @@ def validate_constant
280266 RBS . logger . info "Validating constant: `#{ name } `..."
281267 @validator . validate_type const . decl . type , context : const . context
282268 @builder . ensure_namespace! ( name . namespace , location : const . decl . location )
283- no_self_type_validator ( const . decl . type )
284269 no_classish_type_validator ( const . decl . type )
285270 rescue BaseError => error
286271 @errors . add ( error )
@@ -291,7 +276,6 @@ def validate_global
291276 @env . global_decls . each do |name , global |
292277 RBS . logger . info "Validating global: `#{ name } `..."
293278 @validator . validate_type global . decl . type , context : nil
294- no_self_type_validator ( global . decl . type )
295279 no_classish_type_validator ( global . decl . type )
296280 rescue BaseError => error
297281 @errors . add ( error )
@@ -315,27 +299,23 @@ def validate_type_alias
315299
316300 decl . decl . type_params . each do |param |
317301 if ub = param . upper_bound_type
318- no_self_type_validator ( ub )
319302 no_classish_type_validator ( ub )
320303 @validator . validate_type ( ub , context : nil )
321304 end
322305
323306 if lb = param . lower_bound_type
324- no_self_type_validator ( lb )
325307 no_classish_type_validator ( lb )
326308 @validator . validate_type ( lb , context : nil )
327309 end
328310
329311 if dt = param . default_type
330- no_self_type_validator ( dt )
331312 no_classish_type_validator ( dt )
332313 @validator . validate_type ( dt , context : nil )
333314 end
334315 end
335316
336317 TypeParamDefaultReferenceError . check! ( decl . decl . type_params )
337318
338- no_self_type_validator ( decl . decl . type )
339319 no_classish_type_validator ( decl . decl . type )
340320 rescue BaseError => error
341321 @errors . add ( error )
0 commit comments