Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
153 additions
and
47 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
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,13 @@ | ||
TestInvisibleDefs_fail.scala:5: error: type argIsHello is not a member of package tastytest | ||
def foo: tastytest.argIsHello = ??? // has invisible flag so should not be seen | ||
^ | ||
TestInvisibleDefs_fail.scala:6: error: type argIsHello is not a member of package tastytest | ||
def bar: tastytest.argIsHello = ??? // second try on same type | ||
^ | ||
TestInvisibleDefs_fail.scala:11: error: value getStatus is not a member of tastytest.InvisibleDefs.MyBean | ||
mybean.getStatus() // error | ||
^ | ||
TestInvisibleDefs_fail.scala:12: error: value setStatus is not a member of tastytest.InvisibleDefs.MyBean | ||
mybean.setStatus("closed") // error | ||
^ | ||
4 errors |
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,15 @@ | ||
package tastytest | ||
|
||
object TestInvisibleDefs { | ||
|
||
def foo: tastytest.argIsHello = ??? // has invisible flag so should not be seen | ||
def bar: tastytest.argIsHello = ??? // second try on same type | ||
|
||
def testBean = { | ||
val mybean = new InvisibleDefs.MyBean | ||
mybean.status = "open" | ||
mybean.getStatus() // error | ||
mybean.setStatus("closed") // error | ||
} | ||
|
||
} |
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,16 @@ | ||
package tastytest | ||
|
||
import scala.beans.BeanProperty | ||
|
||
object InvisibleDefs { | ||
|
||
@main def argIsHello(arg: String): Unit = assert(arg == "Hello") | ||
|
||
class MyBean { | ||
|
||
@BeanProperty | ||
var status = "" | ||
|
||
} | ||
|
||
} |
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,15 @@ | ||
package tastytest | ||
|
||
object TestInvisibleDefs extends Suite("TestInvisibleDefs") { | ||
|
||
test("invoke '@main def argIsHello'") { | ||
InvisibleDefs.argIsHello("Hello") | ||
} | ||
|
||
test("update bean.status") { | ||
val mybean = new InvisibleDefs.MyBean | ||
mybean.status = "open" | ||
assert(mybean.status === "open") | ||
} | ||
|
||
} |
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,16 @@ | ||
package tastytest | ||
|
||
import scala.beans.BeanProperty | ||
|
||
object InvisibleDefs { | ||
|
||
@main def argIsHello(arg: String): Unit = assert(arg == "Hello") | ||
|
||
class MyBean { | ||
|
||
@BeanProperty | ||
var status = "" | ||
|
||
} | ||
|
||
} |