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
When the ExplicitImplicitTypes wart is applied to a val that's defined in class/object, it fails to trigger.
For example:
test("can't declare implicit vals inside object without a type ascription") {
valresult=WartTestTraverser(ExplicitImplicitTypes) {
objectFoo {
implicitvalfoo=5
}
}
assertError(result)("implicit definitions must have an explicit type ascription")
}
This test fails. It will also fail if object is replaced with class.
On the other hand, if the val is replaced with def the test passes.
Would removing the s.isTerm && s.asTerm.isAccessor bit in this case be a valid solution?
Any pointers as to how this can be fixed would be most welcome.
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
When the
ExplicitImplicitTypes
wart is applied to aval
that's defined in class/object, it fails to trigger.For example:
This test fails. It will also fail if
object
is replaced withclass
.On the other hand, if the
val
is replaced withdef
the test passes.Here's the tree that's being sent to the wart:
The only thing here that's marked
implicit
is no longer aval
and it's also an<accessor>
. As a result, it fails theisSynthetic
check:Would removing the
s.isTerm && s.asTerm.isAccessor
bit in this case be a valid solution?Any pointers as to how this can be fixed would be most welcome.
Thanks
The text was updated successfully, but these errors were encountered: