forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92e1a17
commit 970e288
Showing
38 changed files
with
850 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.2.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package example | ||
|
||
class Access { | ||
private def m1 = ??? | ||
private[this] def m2 = ??? | ||
private[Access] def m3 = ??? | ||
protected def m4 = ??? | ||
protected[this] def m5 = ??? | ||
protected[example] def m6 = ??? | ||
def m7 = ??? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package example | ||
|
||
import scala.language.existentials | ||
import scala.language.higherKinds | ||
import scala.language.reflectiveCalls | ||
|
||
class AdvC[T] { | ||
def t: T = ??? | ||
} | ||
|
||
class Structural { | ||
def s1: { val x: Int } = ??? | ||
def s2 = new { val x: Int = ??? } | ||
def s3 = new { def m(x: Int): Int = ??? } | ||
} | ||
|
||
class Existential { | ||
def e1: List[_] = ??? | ||
} | ||
|
||
class AdvD[CC[B]] extends AdvC[CC[B]] | ||
|
||
object AdvTest { | ||
val s = new Structural | ||
val s1 = s.s1 | ||
val s2 = s.s2 | ||
val s3 = s.s3 | ||
|
||
val e = new Existential | ||
val e1 = e.e1 | ||
val e1x = e.e1.head | ||
locally { | ||
(??? : Any) match { | ||
case e3: List[_] => | ||
val e3x = e3.head | ||
() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package example | ||
import scala.language.higherKinds | ||
|
||
class Anonymous { | ||
this: Anonymous => | ||
|
||
def m1[T[_], B] = ??? | ||
def m2: Map[_, List[_]] = ??? | ||
locally { | ||
??? match { case _: List[_] => } | ||
} | ||
locally { | ||
val x: Int => Int = _ => ??? | ||
} | ||
|
||
trait Foo | ||
var x = new Foo {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package example | ||
|
||
class C1(val x1: Int) extends AnyVal | ||
|
||
class C2(val x2: Int) extends AnyVal | ||
object C2 | ||
|
||
case class C3(x: Int) | ||
|
||
case class C4(x: Int) | ||
object C4 | ||
|
||
object M { | ||
implicit class C5(x: Int) | ||
} | ||
|
||
case class C6(private val x: Int) | ||
|
||
class C7(x: Int) | ||
|
||
class C8(private[this] val x: Int) | ||
|
||
class C9(private[this] var x: Int) | ||
|
||
object N { | ||
val anonClass = new C7(42) { | ||
val local = ??? | ||
} | ||
val anonFun = List(1).map { i => | ||
val local = 2 | ||
local + 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package example | ||
|
||
class AdvA { | ||
def b: AdvB = ??? | ||
} | ||
|
||
class AdvB { | ||
def a: AdvA = ??? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package example | ||
|
||
object EmptyObject {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package example | ||
|
||
class Example { | ||
val a: String = "1" | ||
def a( | ||
x: Int | ||
): String = | ||
x.toString | ||
def a( | ||
x: Int, | ||
y: Int | ||
): String = | ||
a( | ||
x + | ||
y | ||
) | ||
} | ||
|
||
class ExampleInit() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package example | ||
|
||
import scala.concurrent.Future | ||
|
||
object OExample { self => | ||
def main(args: Array[String]): Unit = { | ||
println(1) | ||
} | ||
val x = scala.reflect.classTag[Int] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package example | ||
|
||
// This class should be excluded by semanticdb. | ||
class Exclude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package example | ||
|
||
/*package*/ object p { | ||
private lazy val x = 1 | ||
protected implicit var y: Int = 2 | ||
def z(pp: Int) = 3 | ||
def m[TT] = ??? | ||
abstract class C[+T, -U, V](x: T, y: U, z: V) { | ||
def this() = this(???, ???, ???) | ||
def w: Int | ||
} | ||
type T1 = Int | ||
type T2[T] = S[T] | ||
type U <: Int | ||
type V >: Int | ||
case object X | ||
final class Y | ||
sealed trait Z | ||
class AA(x: Int, val y: Int, var z: Int) | ||
class S[@specialized T] | ||
val List(xs1) = ??? | ||
??? match { case List(xs2) => ??? } | ||
??? match { case _: List[t] => ??? } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//import scala.util.control.NonFatal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// See https://github.com/scalameta/scalameta/issues/1749 | ||
package example | ||
|
||
import scala.math.Ordered.orderingToOrdered | ||
|
||
class Issue1749 { | ||
val x1 = 42 | ||
val x2 = 42 | ||
(x1, x1) | ||
.compare((x2, x2)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package example | ||
|
||
object Test { | ||
val xs = { | ||
val x = 42 | ||
List(x) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package example | ||
|
||
//@MacroAnnotation | ||
class MacroAnnotations | ||
object MacroAnnotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package example | ||
|
||
class MethodUsages { | ||
val m = new Methods[Int] | ||
m.m1 | ||
m.m2() | ||
m.m3(0) | ||
m.m4(0)(0) | ||
m.m5("") | ||
m.m5(0) | ||
m.m6(0) | ||
m.m6(new m.List[Int]) | ||
m.m6(Nil) | ||
m.m7a(m, new m.List[Int]) | ||
m.m7b(new m.List[Int]) | ||
m.`m8().`() | ||
m.m9(null) | ||
m.m10(null) | ||
m.m11(Predef) | ||
m.m11(OExample) | ||
m.m12a(null) | ||
m.m12b(null) | ||
m.m13(0) | ||
m.m15(0) | ||
m.m16(0) | ||
m.m16(0) | ||
m.m17.m() | ||
m.m17(1) | ||
m.m17("") | ||
m.m18.m() | ||
m.m18(1) | ||
m.m18("") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package example | ||
|
||
import scala.math.Ordering | ||
import scala.language.existentials | ||
|
||
class Methods[T] { | ||
class List[T] | ||
type AList[T] = List[T] | ||
def m1 = ??? | ||
def m2() = ??? | ||
def m3(x: Int) = ??? | ||
def m4(x: Int)(y: Int) = ??? | ||
def m5(x: String) = ??? | ||
def m5(x: Int) = ??? | ||
def m6(x: Int) = ??? | ||
def m6(x: List[T]) = ??? | ||
def m6(x: scala.List[T]) = ??? | ||
def m7a[U: Ordering](c: Methods[T], l: List[U]) = ??? | ||
def m7b[U <: T](l: List[U]) = ??? | ||
def `m8().`() = ??? | ||
class `m9().` | ||
def m9(x: `m9().`) = ??? | ||
def m10(x: AList[T]) = ??? | ||
def m11(x: Predef.type) = ??? | ||
def m11(x: OExample.type) = ??? | ||
def m12a(x: {}) = ??? | ||
def m12b(x: { val x: Int }) = ??? | ||
def m13(x: Int @unchecked) = ??? | ||
def m15(x: => Int) = ??? | ||
def m16(x: Int*) = ??? | ||
object m17 { def m() = ??? } | ||
def m17(a: Int) = ??? | ||
def m17(b: String) = ??? | ||
val m18 = m17 | ||
def m18(a: Int) = ??? | ||
def m18(b: String) = ??? | ||
def m19(x: Int, y: Int = 2)(z: Int = 3) = ??? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package example | ||
|
||
object X { | ||
object Y | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package example | ||
|
||
trait OveA { def foo: Int } | ||
class OveB() extends OveA { def foo: Int = 2 } |
Oops, something went wrong.