From 3b68163e4743c3635b7f47d22d2bdab23a5bf650 Mon Sep 17 00:00:00 2001 From: Mirco Dotta Date: Fri, 10 Jan 2014 10:28:08 +0100 Subject: SI-8135 Disabled flaky hyperlinking presentation compiler test This PR (https://github.com/scala/scala/pull/3275#issuecomment-31986434) demonstrates that the test is flaky. The disabled test was introduced with the intent of preventing a regression (here is the commit https://github.com/scala/scala/commit/ccacb06c4928fd6aebc2c2539d7565cb079dc625). It looks like there is a race condition when `askTypeAt(pos)` is called on `implicitly[Foo[A]].foo` where `pos` is matches the end point of the former expression. The issue is that the returned Tree is unattributed, which is why the error "No symbol is associated with tree implicitly[Foo[A]].foo" is reported. --- test/files/presentation/context-bounds1.check | 51 ---------------------- test/files/presentation/context-bounds1/Test.scala | 3 -- .../context-bounds1/src/ContextBounds.scala | 13 ------ test/pending/presentation/context-bounds1.check | 51 ++++++++++++++++++++++ .../presentation/context-bounds1/Test.scala | 3 ++ .../context-bounds1/src/ContextBounds.scala | 13 ++++++ 6 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 test/files/presentation/context-bounds1.check delete mode 100644 test/files/presentation/context-bounds1/Test.scala delete mode 100644 test/files/presentation/context-bounds1/src/ContextBounds.scala create mode 100644 test/pending/presentation/context-bounds1.check create mode 100644 test/pending/presentation/context-bounds1/Test.scala create mode 100644 test/pending/presentation/context-bounds1/src/ContextBounds.scala (limited to 'test') diff --git a/test/files/presentation/context-bounds1.check b/test/files/presentation/context-bounds1.check deleted file mode 100644 index b444de59a4..0000000000 --- a/test/files/presentation/context-bounds1.check +++ /dev/null @@ -1,51 +0,0 @@ -reload: ContextBounds.scala - -askHyperlinkPos for `Blubb` at (2,23) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `Foo` at (4,17) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `Blubb` at (4,32) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `A` at (4,42) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `A` at (4,51) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `blubb` at (4,66) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `blubb` at (2,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `Foo` at (5,18) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `A` at (5,25) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `foo` at (5,36) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `foo` at (10,7) ContextBounds.scala -================================================================================ - -askHyperlinkPos for `A` at (10,14) ContextBounds.scala -================================================================================ -[response] found askHyperlinkPos for `A` at (9,11) ContextBounds.scala -================================================================================ diff --git a/test/files/presentation/context-bounds1/Test.scala b/test/files/presentation/context-bounds1/Test.scala deleted file mode 100644 index bec1131c4c..0000000000 --- a/test/files/presentation/context-bounds1/Test.scala +++ /dev/null @@ -1,3 +0,0 @@ -import scala.tools.nsc.interactive.tests.InteractiveTest - -object Test extends InteractiveTest \ No newline at end of file diff --git a/test/files/presentation/context-bounds1/src/ContextBounds.scala b/test/files/presentation/context-bounds1/src/ContextBounds.scala deleted file mode 100644 index 72a8f694a3..0000000000 --- a/test/files/presentation/context-bounds1/src/ContextBounds.scala +++ /dev/null @@ -1,13 +0,0 @@ -object ContextBound { - val blubb = new Blubb/*#*/ - - def work[A: Foo/*#*/](f: Blubb/*#*/ => A/*#*/): A/*#*/ = f(blubb/*#*/) ensuring { - implicitly[Foo/*#*/[A/*#*/]].foo/*#*/(_) >= 42 - } -} - -trait Foo[A] { - def foo(a: A/*#*/): Int -} - -class Blubb \ No newline at end of file diff --git a/test/pending/presentation/context-bounds1.check b/test/pending/presentation/context-bounds1.check new file mode 100644 index 0000000000..b444de59a4 --- /dev/null +++ b/test/pending/presentation/context-bounds1.check @@ -0,0 +1,51 @@ +reload: ContextBounds.scala + +askHyperlinkPos for `Blubb` at (2,23) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Foo` at (4,17) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Blubb` at (4,32) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (4,42) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (4,51) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `blubb` at (4,66) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `blubb` at (2,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Foo` at (5,18) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (5,25) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `foo` at (5,36) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `foo` at (10,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (10,14) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (9,11) ContextBounds.scala +================================================================================ diff --git a/test/pending/presentation/context-bounds1/Test.scala b/test/pending/presentation/context-bounds1/Test.scala new file mode 100644 index 0000000000..bec1131c4c --- /dev/null +++ b/test/pending/presentation/context-bounds1/Test.scala @@ -0,0 +1,3 @@ +import scala.tools.nsc.interactive.tests.InteractiveTest + +object Test extends InteractiveTest \ No newline at end of file diff --git a/test/pending/presentation/context-bounds1/src/ContextBounds.scala b/test/pending/presentation/context-bounds1/src/ContextBounds.scala new file mode 100644 index 0000000000..72a8f694a3 --- /dev/null +++ b/test/pending/presentation/context-bounds1/src/ContextBounds.scala @@ -0,0 +1,13 @@ +object ContextBound { + val blubb = new Blubb/*#*/ + + def work[A: Foo/*#*/](f: Blubb/*#*/ => A/*#*/): A/*#*/ = f(blubb/*#*/) ensuring { + implicitly[Foo/*#*/[A/*#*/]].foo/*#*/(_) >= 42 + } +} + +trait Foo[A] { + def foo(a: A/*#*/): Int +} + +class Blubb \ No newline at end of file -- cgit v1.2.3