Aladdin - Scala Bugtracking
[#616] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2006-05-30 11:59:32.0
subject [contrib #150] no implicit conversions for member selections with target 'this'
code
object testImplicit {
	implicit def foo2bar(foo :Foo) :Bar = foo.bar
	class Foo(val bar :Bar) {
	    def testCoercion = {val a = this; a.baz} // here, foo2bar is inferred  by the compiler, as expected 
	    def testCoercionThisImplicit = baz  // --> error: not found: value baz
	    def testCoercionThisExplicit = this.baz  // --> error: value baz is not a  member of Foo
	}
	trait Bar { def baz :unit}
}
// mentioned before: http://thread.gmane.org/gmane.comp.lang.scala/2038,
// but couldn't find a bug report
what happened
foo2bar is only inferred when an explicit target (!= 'this') is given
what expected that foo2bar would be inferred in each case
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-05-30 12:01:22.0
Transferred from the contributions
Martin  edited on  2006-05-31 11:46:28.0