Shading traits that contain fields causes AbstractMethodError when tring to instantiate a class that extends it. Shading the following trait
package com.jarjar
trait ScalaTrait { val a = 1 }
and then extending it and instantiating the class surfaces the issue:
class ExtendedTrait extends shaded.com.jarjar.ScalaTrait
new ExtendedTrait
The ExtendedTrait class implements shaded$com$jarjar$ScalaTrait$_setter_$a_$eq(int) (name constructed from the symbols in the scala signature of ScalaTrait), but the abstract getter method name was not updated during shading in ScalaTrait, so com$jarjar$ScalaTrait$_setter_$a_$eq(int) remains unimplemented.
Shading traits that contain fields causes
AbstractMethodError
when tring to instantiate a class that extends it. Shading the following traitand then extending it and instantiating the class surfaces the issue:
The
ExtendedTrait
class implementsshaded$com$jarjar$ScalaTrait$_setter_$a_$eq(int)
(name constructed from the symbols in the scala signature ofScalaTrait
), but the abstract getter method name was not updated during shading inScalaTrait
, socom$jarjar$ScalaTrait$_setter_$a_$eq(int)
remains unimplemented.