miniboxing-plugin icon indicating copy to clipboard operation
miniboxing-plugin copied to clipboard

Inner classes type param warnings: only when type params are there

Open VladUreche opened this issue 9 years ago • 0 comments

$ cat inner.scala 
class C[@miniboxed T] {
  // should warn, since E contains refs to T:
  class E(t: T)

  // should not warn, since F does not have them:
  class F
}

$ mb-scalac inner.scala
inner.scala:3: warning: The class E will not be miniboxed based on type parameter(s) T of miniboxed class C. To have it specialized, add the type parameters of class C, marked with "@miniboxed" to the definition of class E and instantiate it explicitly passing the type parameters from class C:
  class E(t: T)
        ^
inner.scala:6: warning: The class F will not be miniboxed based on type parameter(s) T of miniboxed class C. To have it specialized, add the type parameters of class C, marked with "@miniboxed" to the definition of class F and instantiate it explicitly passing the type parameters from class C:
  class F
        ^
two warnings found

VladUreche avatar Nov 12 '15 17:11 VladUreche