Skip to content

Some generated public members don't have explicit return types #103

@ceedubs

Description

@ceedubs

Currently annotating a type with @typeclass generates members that don't have explicit return types. This conflicts with the Wart.PublicInference WartRemover rule.

You can see this issue with the simulacrum library by making adding this wart to build.sbt (see diff below). This results in a bunch of errors similar to the following:

src/test/scala/simulacrum/examples/examples.scala:13:8: [wartremover:PublicInference] Public member must have an explicit type ascription
[error]       @typeclass trait Semigroup[A] {                                                                                                                                                
[error]        ^
diff --git a/build.sbt b/build.sbt
index 7f9479d..2e50f40 100644
--- a/build.sbt
+++ b/build.sbt
@@ -85,7 +85,8 @@ lazy val commonSettings = Seq(
   useGpgAgent := true,
   wartremoverErrors in (Test, compile) ++= Seq(
     Wart.ExplicitImplicitTypes,
-    Wart.ImplicitConversion)
+    Wart.ImplicitConversion,
+    Wart.PublicInference)
 ) ++ Seq(Compile, Test).map{ scope =>
   scalacOptions in (scope, compile) := {
     CrossVersion.partialVersion(scalaVersion.value) match {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions