summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 99cf1ee4e5..e31de3d38a 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -694,6 +694,12 @@ module Bundler
next
end
+ # Gem::Dependency#== matches Gem::Dependency#type. As the lockfile
+ # doesn't carry a notion of the dependency type, if you use
+ # add_development_dependency in a gemspec that's loaded with the gemspec
+ # directive, the lockfile dependencies and resolved dependencies end up
+ # with a mismatch on #type. Work around that by setting the type on the
+ # dep from the lockfile.
locked_dep.instance_variable_set(:@type, dependency.type)
# We already know the name matches from the hash lookup