eed3si9n / treehugger

treehugger.scala is a library to code Scala programmatically.
http://eed3si9n.com/treehugger
Other
133 stars 20 forks source link

fix adaptation argument warning #53

Closed xuwei-k closed 6 years ago

xuwei-k commented 6 years ago

https://travis-ci.org/eed3si9n/treehugger/jobs/399664958#L799

[warn] /home/travis/build/eed3si9n/treehugger/library/src/main/scala/treehugger/TreeGen.scala:246: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous.
[warn]         signature: Constant.apply(value: Any): Constants.this.Constant
[warn]   given arguments: <none>
[warn]  after adaptation: Constant((): Unit)
[warn]       case UnitClass    => Literal(Constant())
[warn]                                            ^
[warn] /home/travis/build/eed3si9n/treehugger/library/src/main/scala/treehugger/TreeGen.scala:262: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous.
[warn]         signature: Constant.apply(value: Any): Constants.this.Constant
[warn]   given arguments: <none>
[warn]  after adaptation: Constant((): Unit)
[warn]     if (elems.isEmpty) Literal(Constant())
[warn]                                        ^