diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-18 18:54:27 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-18 18:54:27 +0000 |
commit | 8c713da3d02131bb3931c152a6bda9785e1f464e (patch) | |
tree | 9f9372144f22356be4dc2ab41d93218485203f68 /test/files | |
parent | 98de3e5bad0e670fbe2e0ea6d511dc57b282f332 (diff) | |
download | scala-8c713da3d02131bb3931c152a6bda9785e1f464e.tar.gz scala-8c713da3d02131bb3931c152a6bda9785e1f464e.tar.bz2 scala-8c713da3d02131bb3931c152a6bda9785e1f464e.zip |
What is, I think, the only possible solution to...
What is, I think, the only possible solution to bug #4158 given the
current ways of controlling implicits. Let's just be glad there's one
instead of zero. Closes #4158, review by moors.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug4158.check | 19 | ||||
-rw-r--r-- | test/files/neg/bug4158.scala | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/neg/bug4158.check b/test/files/neg/bug4158.check new file mode 100644 index 0000000000..0d9873dc32 --- /dev/null +++ b/test/files/neg/bug4158.check @@ -0,0 +1,19 @@ +bug4158.scala:3: error: type mismatch; + found : Null(null) + required: Int +Note that implicit conversions are not applicable because they are ambiguous: + both method Integer2intNullConflict in class LowPriorityImplicits of type (x: Null)Int + and method Integer2int in object Predef of type (x: java.lang.Integer)Int + are possible conversion functions from Null(null) to Int + var y = null: Int + ^ +bug4158.scala:2: error: type mismatch; + found : Null(null) + required: Int +Note that implicit conversions are not applicable because they are ambiguous: + both method Integer2intNullConflict in class LowPriorityImplicits of type (x: Null)Int + and method Integer2int in object Predef of type (x: java.lang.Integer)Int + are possible conversion functions from Null(null) to Int + var x: Int = null + ^ +two errors found diff --git a/test/files/neg/bug4158.scala b/test/files/neg/bug4158.scala new file mode 100644 index 0000000000..07aa69a95c --- /dev/null +++ b/test/files/neg/bug4158.scala @@ -0,0 +1,4 @@ +class A { + var x: Int = null + var y = null: Int +}
\ No newline at end of file |