diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2013-03-07 18:55:46 +0100 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2013-03-07 21:39:58 +0100 |
commit | 292435f5cac948b611671e6495b4676ddbbc4c10 (patch) | |
tree | 410247b5d2100c5978ffd2b3a0ae36cffadcf948 /test/files/presentation/hyperlinks/src/SuperTypes.scala | |
parent | 889020dfab9f99a3198528fedb699c061027acab (diff) | |
download | scala-292435f5cac948b611671e6495b4676ddbbc4c10.tar.gz scala-292435f5cac948b611671e6495b4676ddbbc4c10.tar.bz2 scala-292435f5cac948b611671e6495b4676ddbbc4c10.zip |
Fix SI-7224.
Don't focus positions assigned to the TypeTree of a parent of a Template
when the parent exists in the source. A focused position (instance
of `OffsetPosition`) makes it invisible to the presentation compiler
when it looks for the innermost enclosing tree of a given position
(breaking hyperlinking, for example).
Diffstat (limited to 'test/files/presentation/hyperlinks/src/SuperTypes.scala')
-rw-r--r-- | test/files/presentation/hyperlinks/src/SuperTypes.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/files/presentation/hyperlinks/src/SuperTypes.scala b/test/files/presentation/hyperlinks/src/SuperTypes.scala new file mode 100644 index 0000000000..15d16069fd --- /dev/null +++ b/test/files/presentation/hyperlinks/src/SuperTypes.scala @@ -0,0 +1,32 @@ +/** This tests that hyperlinking works for super types. See SI-7224 */ +class BadPos[A](a: A) + +class Base + +trait Trait extends Base +trait SubTrait extends Trait +trait LateralTrait extends Base + +object obj1 extends BadPos/*#*/(new Object) +object obj2 extends BadPos/*#*/[AnyRef](new Object) +object obj3 extends Trait/*#*/ +object obj4 extends SubTrait/*#*/ +object obj5 extends Trait/*#*/ with LateralTrait/*#*/ +object obj6 extends Base/*#*/ with Trait/*#*/ with LateralTrait/*#*/ + +class PBase[A] + +trait PTrait[A] extends PBase/*#*/[A] +trait PSubTrait[A] extends PTrait/*#*/[A] +trait PLateralTrait[A] extends PBase/*#*/[A] + +object pobj2 extends PTrait/*#*/[Int] +object pobj3 extends PSubTrait/*#*/[Int] +object pobj4 extends PTrait/*#*/[Int] with PLateralTrait/*#*/[Int] +object pobj5 extends PBase/*#*/[Int] with PTrait/*#*/[Int] with PLateralTrait/*#*/[Int] + +class c1 extends BadPos/*#*/(new Object) +class c2 extends PTrait/*#*/[Int] +class c3 extends PSubTrait/*#*/[Int] +class c4 extends PTrait/*#*/[Int] with PLateralTrait/*#*/[Int] +class c5 extends PBase/*#*/[Int] with PTrait/*#*/[Int] with PLateralTrait/*#*/[Int] |