diff options
author | Paul Phillips <paulp@improving.org> | 2011-05-31 09:02:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-05-31 09:02:29 +0000 |
commit | fb061f22d4c35df626d9651e017820a11f8fe56e (patch) | |
tree | 17b7771b77f70b142be50fdbf967199c10ffff18 /test/files/pos | |
parent | 1c2d44dda075ef63933502f0791d500f8650a457 (diff) | |
download | scala-fb061f22d4c35df626d9651e017820a11f8fe56e.tar.gz scala-fb061f22d4c35df626d9651e017820a11f8fe56e.tar.bz2 scala-fb061f22d4c35df626d9651e017820a11f8fe56e.zip |
A getter with type params is still a getter.
There were two distinct bugs in here, which if I ran the world would be
a wakeup call that robust software cannot emerge from thousands of lines
of low-level AST matching. In case you are frozen in suspense: I do not
run the world. Review by moors.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/bug4237.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/pos/bug4237.scala b/test/files/pos/bug4237.scala new file mode 100644 index 0000000000..fcf6eb8bf1 --- /dev/null +++ b/test/files/pos/bug4237.scala @@ -0,0 +1,6 @@ +class A { + (new { def field = 0; def field_=(i: Int) = () }).field = 5 // compiles as expected + (new { def field(implicit i: Int) = 0; def field_=(i: Int) = () }).field = 5 // compiles even with implicit params on getter + (new { def field = 0; def field_=[T](i: Int) = () }).field = 5 // compiles with type param on setter + (new { def field[T] = 0; def field_=(i: Int) = () }).field = 5 // DOESN'T COMPILE +}
\ No newline at end of file |