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.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
19 changed files
with
174 additions
and
43 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
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,9 @@ | ||
ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") | ||
|
||
lazy val i20476 = project | ||
.in(file("i20476")) | ||
.enablePlugins(ScalaJSPlugin) | ||
|
||
lazy val i18231 = project | ||
.in(file("i18231")) | ||
.settings(scalacOptions += "-release:8") |
4 changes: 4 additions & 0 deletions
4
sbt-test/sbt-dotty/scaladoc-regressions/i18231/src/main/scala/main.scala
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 @@ | ||
object Foo { | ||
@Deprecated | ||
def foo(): Unit = ??? | ||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/sbt-dotty/scaladoc-regressions/i20476/src/main/scala/main.scala
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 demo | ||
|
||
import scala.scalajs.js | ||
|
||
def bar: js.Promise[Int] = js.Promise.resolve(()).`then`(_ => 1) |
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 @@ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % sys.props("plugin.scalaJSVersion")) |
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,2 @@ | ||
> i18231/doc | ||
> i20476/doc |
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
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,15 @@ | ||
class MetricsGroup[A] | ||
object MetricsGroup: | ||
import scala.quoted.* | ||
|
||
transparent inline final def refine[A]: MetricsGroup[A] = | ||
${ refineImpl[A] } | ||
|
||
private def refineImpl[A](using qctx: Quotes, tpe: Type[A]): Expr[MetricsGroup[A]] = | ||
import qctx.reflect.* | ||
|
||
val mt = MethodType(Nil)(_ => Nil, _ => TypeRepr.of[A]) | ||
val tpe = Refinement(TypeRepr.of[MetricsGroup[A]], "apply", mt).asType | ||
tpe match | ||
case '[tpe] => | ||
'{ MetricsGroup[A]().asInstanceOf[MetricsGroup[A] & tpe] } |
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,13 @@ | ||
//> using options -experimental -Ydebug | ||
|
||
class ProbeFailedException(cause: Exception) extends Exception(cause) | ||
trait Probing: | ||
self: Metrics => | ||
val probeFailureCounter: MetricsGroup[Counter] = | ||
counters("ustats_probe_failures_count").labelled | ||
|
||
|
||
trait Counter | ||
class Metrics: | ||
class counters(name: String): | ||
transparent inline final def labelled: MetricsGroup[Counter] = MetricsGroup.refine[Counter] |
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 @@ | ||
// See also tests/pos/annot-21595.scala | ||
|
||
class local(predicate: Int) extends annotation.StaticAnnotation | ||
|
||
def failing1(x: Int, z: Int @local(x + 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,30 @@ | ||
class dummy(b: Any) extends annotation.StaticAnnotation | ||
|
||
class X: | ||
def foo() = 1 | ||
def bar() = 2 | ||
def eq(x: X) = true | ||
def id(): this.type = this | ||
|
||
class Y extends X: | ||
override def bar() = 2 | ||
override def eq(x: X) = true | ||
|
||
def f(x: Int) = x | ||
def g(x: String) = x | ||
def g(x: Int) = x | ||
|
||
object AnnotationTests: | ||
def foo1(elem: Int, bla: Int @dummy(Array(elem))) = bla | ||
def foo2(elem: X, bla: Int @dummy(elem.foo())) = bla | ||
def foo3(elem: Y, bla: Int @dummy(elem.foo())) = bla | ||
def foo4(elem: X, bla: Int @dummy(elem.bar())) = bla | ||
def foo5(elem: Y, bla: Int @dummy(elem.bar())) = bla | ||
def foo6(elem: X, bla: Int @dummy(elem.eq(X()))) = bla | ||
def foo7(elem: Y, bla: Int @dummy(elem.eq(Y()))) = bla | ||
def foo8(elem: X, bla: Int @dummy(elem.id().foo())) = bla | ||
def foo9(elem: Y, bla: Int @dummy(elem.id().foo())) = bla | ||
def foo10(elem: Int, bla: Int @dummy(f(elem))) = bla | ||
def foo11(elem: Int, bla: Int @dummy(g(elem))) = bla | ||
def foo12(elem: Int, bla: Int @dummy(0 == elem)) = bla | ||
def foo13(elem: Int, bla: Int @dummy(elem == 0)) = bla |