summaryrefslogtreecommitdiff
path: root/test/files/pos/t3177.scala
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-05-05 08:37:12 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-05-05 08:37:12 +0000
commitf2acf335edf66454f45f1b69c233abeb74b76282 (patch)
tree1c762c0e4d9de7924e5089dad57a7637cdb58c96 /test/files/pos/t3177.scala
parent4e4e1e4c759c14fbc45f92072b692fa3b9540ba0 (diff)
downloadscala-f2acf335edf66454f45f1b69c233abeb74b76282.tar.gz
scala-f2acf335edf66454f45f1b69c233abeb74b76282.tar.bz2
scala-f2acf335edf66454f45f1b69c233abeb74b76282.zip
Merged revisions 21777-21779,21783-21784,21787-...
Merged revisions 21777-21779,21783-21784,21787-21802 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r21777 | dragos | 2010-05-02 19:41:59 +0200 (Sun, 02 May 2010) | 1 line Properly specialize superclasses of a specialized class. ........ r21778 | dragos | 2010-05-02 19:42:06 +0200 (Sun, 02 May 2010) | 1 line Closes #3382. no review. ........ r21779 | dragos | 2010-05-02 19:42:10 +0200 (Sun, 02 May 2010) | 1 line Fixed private member access, closes #3380. no review. ........ r21783 | dragos | 2010-05-03 09:58:15 +0200 (Mon, 03 May 2010) | 2 lines Renamed Idea project files to have a .SAMPLE suffix. Having to constantly remove them from each commit was too cumbersome. ........ r21784 | phaller | 2010-05-03 11:35:13 +0200 (Mon, 03 May 2010) | 1 line Increased partest per-test timeout in an attempt to fix the windows nightly. ........ r21787 | dragos | 2010-05-04 11:34:50 +0200 (Tue, 04 May 2010) | 3 lines Removed 4-year old println when getModuleOrClass fails. It polluted debug output when -Ydebug was present because now every (successful) compiler run hits a few MissingRequirementErrors, quietly swallowed by getModule2/getClass2. The errors are normal during the transition to 'scala.collection.immutable.List' and 'scala.Seq/Sequence', while definitions are built. No review. ........ r21788 | dragos | 2010-05-04 11:34:55 +0200 (Tue, 04 May 2010) | 1 line Closes #3378. No review. ........ r21789 | dragos | 2010-05-04 11:34:58 +0200 (Tue, 04 May 2010) | 1 line Fixed abstract overrides of specialized methods. Closes #3379, no review. Added test files for latest bug fixes. ........ r21790 | moors | 2010-05-04 15:53:09 +0200 (Tue, 04 May 2010) | 2 lines closes #3373, #3177: validity check of an implicit value should consider the value as well as its accessor review by odersky ........ r21791 | rytz | 2010-05-04 16:01:58 +0200 (Tue, 04 May 2010) | 1 line fix and test where constructor parameter annotations end up. no review ........ r21792 | moors | 2010-05-04 16:03:47 +0200 (Tue, 04 May 2010) | 1 line sorry, last-minute edit broke build: re-added parens ........ r21793 | moors | 2010-05-04 16:36:14 +0200 (Tue, 04 May 2010) | 6 lines Revert r21790: "closes #3373, #3177: validity check of an implicit " value should consider the value as well as its accessor Revert " r21792: "sorry, last-minute edit broke build: re-added parens " will investigate how it broke and why my local pre-commit tests did not catch the failure... no review ........ r21794 | rytz | 2010-05-04 16:40:10 +0200 (Tue, 04 May 2010) | 1 line close #3384. cleaned up constructor defaults. see #3338 see #3344 see #2057 see #3207. no review ........ r21795 | phaller | 2010-05-04 16:54:57 +0200 (Tue, 04 May 2010) | 1 line Some more, hopefully temporary, partest timeout tweaks. No review. ........ r21796 | imaier | 2010-05-04 17:06:23 +0200 (Tue, 04 May 2010) | 1 line Fixed #3274. No review. ........ r21797 | odersky | 2010-05-04 18:00:15 +0200 (Tue, 04 May 2010) | 1 line Fixed StringBuilder#last performance problem. ........ r21798 | moors | 2010-05-04 18:21:13 +0200 (Tue, 04 May 2010) | 2 lines revert commit that probably broke the build due to a bug in closure elimination revert commit that reverted the commit that probably didn't break the build ........ r21799 | dragos | 2010-05-04 18:59:28 +0200 (Tue, 04 May 2010) | 1 line Closes #3387. no review. ........ r21800 | dragos | 2010-05-04 19:07:41 +0200 (Tue, 04 May 2010) | 1 line Fixed broken commit. no review. ........ r21801 | extempore | 2010-05-04 20:33:41 +0200 (Tue, 04 May 2010) | 1 line Fix for #3391. No review. ........ r21802 | dragos | 2010-05-04 23:59:18 +0200 (Tue, 04 May 2010) | 1 line Fixing the conflict between the two private-related bugs, fixing the build. no review. ........
Diffstat (limited to 'test/files/pos/t3177.scala')
-rw-r--r--test/files/pos/t3177.scala39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/files/pos/t3177.scala b/test/files/pos/t3177.scala
new file mode 100644
index 0000000000..9f9528faec
--- /dev/null
+++ b/test/files/pos/t3177.scala
@@ -0,0 +1,39 @@
+trait InvariantFunctor[F[_]] {
+ def xmap[A, B](ma: F[A], f: A => B, g: B => A): F[B]
+}
+
+object InvariantFunctor {
+ import Endo._
+
+ implicit val EndoInvariantFunctor = new InvariantFunctor[Endo] {
+ def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b)))
+ }
+
+ // The definition about fails with:
+ // anon-type.scala:9: error: not found: value b
+ // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b)))
+ // ^
+ // anon-type.scala:8: error: not found: type $anon
+ // implicit val EndoInvariantFunctor = new InvariantFunctor[Endo] {
+ // ^
+
+
+ // These both work:
+ // implicit val EndoInvariantFunctorAscribed: InvariantFunctor[Endo] = new InvariantFunctor[Endo] {
+ // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b)))
+ // }
+ //
+ // implicit val EndoInvariantFunctorStubbed = new InvariantFunctor[Endo] {
+ // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = error("stub")
+ // }
+}
+
+trait Endo[X]
+
+object Endo {
+ implicit def EndoTo[A](f: A => A): Endo[A] = new Endo[A] {
+ def apply(a: A) = f(a)
+ }
+
+ implicit def EndoFrom[A](e: Endo[A]): A => A = e.apply(_)
+} \ No newline at end of file