Skip to content

Commit

Permalink
Add TypeParamDefaultReferenceError#type_param
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Sep 30, 2024
1 parent 4e5ce53 commit b22834c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rbs/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,13 @@ def initialize(message, location:)
class TypeParamDefaultReferenceError < DefinitionError
include DetailedMessageable

attr_reader :type_param
attr_reader :location

def initialize(type_param, location:)
super "#{Location.to_string(location)}: the default of #{type_param.name} cannot include optional type parameter"
@location = location
@type_param = type_param
end

def self.check!(type_params)
Expand Down
2 changes: 2 additions & 0 deletions sig/errors.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ module RBS
class TypeParamDefaultReferenceError < BaseError
include DetailedMessageable

attr_reader type_param: AST::TypeParam

def initialize: (AST::TypeParam, location: Location[untyped, untyped]?) -> void

attr_reader location: Location[untyped, untyped]?
Expand Down

0 comments on commit b22834c

Please sign in to comment.