Skip to content

Commit

Permalink
Receive ancestor_builder and method_builder in DefinitionBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Feb 24, 2021
1 parent 6be9700 commit 05e51b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rbs/definition_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class DefinitionBuilder
attr_reader :singleton0_cache
attr_reader :interface_cache

def initialize(env:)
def initialize(env:, ancestor_builder: nil, method_builder: nil)
@env = env
@type_name_resolver = TypeNameResolver.from_env(env)
@ancestor_builder = AncestorBuilder.new(env: env)
@method_builder = MethodBuilder.new(env: env)
@ancestor_builder = ancestor_builder || AncestorBuilder.new(env: env)
@method_builder = method_builder || MethodBuilder.new(env: env)

@instance_cache = {}
@singleton_cache = {}
Expand Down
2 changes: 1 addition & 1 deletion sig/definition_builder.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module RBS
attr_reader singleton0_cache: Hash[TypeName, Definition | false | nil]
attr_reader interface_cache: Hash[TypeName, Definition | false | nil]

def initialize: (env: Environment) -> void
def initialize: (env: Environment, ?ancestor_builder: AncestorBuilder?, ?method_builder: MethodBuilder?) -> void

def validate_super_class!: (TypeName, Environment::ClassEntry) -> void

Expand Down

0 comments on commit 05e51b0

Please sign in to comment.