You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for being the bearer of bad news, but there appears to be a regression in 1.7.0 . The any matcher (or its underlying macro) is now unable to resolve those stable paths for a value class enclosed in an object that are prefixed with identifier of the same enclosing object.
Test code:
packagecom.example.testimportorg.mockito.{ ArgumentMatchersSugar, IdiomaticMockito }
importorg.scalatest.{ FlatSpec, Matchers }
classNestedReproSpecextendsFlatSpecwithMatcherswithIdiomaticMockitowithArgumentMatchersSugar {
valexampler= mock[Exampler]
it should "compile a nested value class with direct symbolic reference" in {
importNesting.NestedValueClass"exampler(any[NestedValueClass]) returns ???" should compile
}
it should "compile a nested value class with reference to enclosing object" in {
"exampler(any[Nesting.NestedValueClass]) returns ???" should compile
}
}
objectNesting {
caseclassNestedValueClass(value: String) extendsAnyVal
}
traitExampler {
defapply(v: Nesting.NestedValueClass):String
}
Result:
NestedReproSpec:
- should compile a nested value class with direct symbolic reference
- should compile a nested value class with reference to enclosing object *** FAILED ***
Expected no compiler error, but got the following type error: "not found: value NestedValueClass", for code: exampler(any[Nesting.NestedValueClass]) returns ??? (NestedReproSpec.scala:16)
Not 100% sure if the bug does not affect non-value-classes, but haven't seen such a case yet.
The text was updated successfully, but these errors were encountered:
Sorry for being the bearer of bad news, but there appears to be a regression in 1.7.0 . The
any
matcher (or its underlying macro) is now unable to resolve those stable paths for a value class enclosed in anobject
that are prefixed with identifier of the same enclosingobject
.Test code:
Result:
Not 100% sure if the bug does not affect non-value-classes, but haven't seen such a case yet.
The text was updated successfully, but these errors were encountered: