This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from scala/topic/java-fields
- Loading branch information
Showing
5 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package scala.pickling.javafieldfail | ||
|
||
import scala.pickling._ | ||
import NegativeCompilation._ | ||
import org.scalatest.FunSuite | ||
|
||
class JavaFieldFailTest extends FunSuite { | ||
test("x.pickle does not compile for FakeByte") { | ||
expectError("Cannot generate") { | ||
"""import _root_.scala.pickling._ | ||
|import _root_.scala.pickling.Defaults._ | ||
|import _root_.scala.pickling.json._ | ||
|import _root_.scala.pickling.static._ | ||
|import scala.pickling.javafieldfail.FakeByte | ||
| | ||
|val x: FakeByte = new FakeByte(10) | ||
|val pkl = x.pickle""".stripMargin | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package scala.pickling.javafieldfail; | ||
|
||
public final class FakeByte { | ||
private static final long serialVersionUID = 1L; | ||
private final byte value; | ||
|
||
public FakeByte(byte value) { | ||
this.value = value; | ||
} | ||
|
||
public byte byteValue() { | ||
return value; | ||
} | ||
} |