diff options
author | odersky <odersky@gmail.com> | 2016-11-16 14:54:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 14:54:02 +0100 |
commit | 6990bb37ee070ad4ffea21eb7557c4b438f1b295 (patch) | |
tree | 1d85f4adbba3a3d70b18d12799d9544dee939751 | |
parent | b8262a5214cc046c0942ce24f637d7318b91fc36 (diff) | |
parent | 82e2ac52926846cebc1ec3a5b5aa4037eeecf93a (diff) | |
download | dotty-6990bb37ee070ad4ffea21eb7557c4b438f1b295.tar.gz dotty-6990bb37ee070ad4ffea21eb7557c4b438f1b295.tar.bz2 dotty-6990bb37ee070ad4ffea21eb7557c4b438f1b295.zip |
Merge pull request #1695 from dotty-staging/fix-#1662
Fix #1662: Add missing case for singleton
-rw-r--r-- | src/dotty/tools/dotc/ast/tpd.scala | 5 | ||||
-rw-r--r-- | tests/neg/i1662.scala | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala index db2ce5649..fc96735b0 100644 --- a/src/dotty/tools/dotc/ast/tpd.scala +++ b/src/dotty/tools/dotc/ast/tpd.scala @@ -306,8 +306,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { case _ => false } - typeIsElidable || - tp.symbol.is(JavaStatic) || + typeIsElidable || + tp.symbol.is(JavaStatic) || tp.symbol.hasAnnotation(defn.ScalaStaticAnnot) } @@ -343,6 +343,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def singleton(tp: Type)(implicit ctx: Context): Tree = tp match { case tp: TermRef => ref(tp) case tp: ThisType => This(tp.cls) + case tp: SkolemType => singleton(tp.narrow) case SuperType(qual, _) => singleton(qual) case ConstantType(value) => Literal(value) } diff --git a/tests/neg/i1662.scala b/tests/neg/i1662.scala new file mode 100644 index 000000000..1f9d02ba6 --- /dev/null +++ b/tests/neg/i1662.scala @@ -0,0 +1,6 @@ +class Lift { + def apply(f: F0) // error + class F0 + object F0 { implicit def f2f0(String): F0 = ??? } // error + (new Lift)("") +} |