Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traverse synthetic top-level members in API #572

Merged
merged 4 commits into from Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .sbtopts

This file was deleted.

1 change: 0 additions & 1 deletion internal/compiler-bridge/src/main/scala/xsbt/API.scala
Expand Up @@ -89,7 +89,6 @@ final class API(val global: CallbackGlobal) extends Compat with GlobalHelpers {
!ignoredSymbol(sym) &&
sym.isStatic &&
!sym.isImplClass &&
!sym.hasFlag(Flags.SYNTHETIC) &&
!sym.hasFlag(Flags.JAVA) &&
!sym.isNestedClass
}
Expand Down
Expand Up @@ -276,8 +276,9 @@ class ExtractUsedNames[GlobalType <: CallbackGlobal](val global: GlobalType)

case t if t.hasSymbolField =>
val symbol = t.symbol
if (symbol != rootMirror.RootPackage)
if (symbol != rootMirror.RootPackage) {
addSymbol(getNamesOfEnclosingScope, t.symbol)
}

val tpe = t.tpe
if (!ignoredType(tpe)) {
Expand Down
@@ -0,0 +1,3 @@
case class A (
name: String
)
@@ -0,0 +1,4 @@
object UseSite extends App {
println("hello world")
val y = A("5")
}
@@ -0,0 +1,3 @@
case class A(
name: Int
)
@@ -0,0 +1,4 @@
case class A(
name: Int,
ms: Long = 0L
)
@@ -0,0 +1,4 @@
case class A(
name: Int,
ms: String = ""
)
@@ -0,0 +1,4 @@
case class A(
name: Int,
ms: Char = 'c'
)
@@ -0,0 +1,4 @@
object UseSite extends App {
println("hello world")
val y = A(5)
}
@@ -0,0 +1,4 @@
object UseSite extends App {
println("hello world")
val y = A(5, "asdf")
}
@@ -0,0 +1,2 @@
apiDebug = true
relationsDebug = true
@@ -0,0 +1,13 @@
> compile
$ copy-file changes/A.scala A.scala
-> compile
$ copy-file changes/UseSite.scala UseSite.scala
> run
$ copy-file changes/A2.scala A.scala
> run
$ copy-file changes/A3.scala A.scala
> run
$ copy-file changes/UseSite2.scala UseSite.scala
> run
$ copy-file changes/A4.scala A.scala
-> compile
@@ -1,3 +1,4 @@
> compile
$ copy-file changes/A1.scala A.scala
> compile
> checkIterations 2
@@ -1,7 +1,6 @@
import foo.Foo
package foo
import Baz.myNr


class Bar {
val nr: Int = implicitly
}
val nr: Int = implicitly[Int]
}
@@ -1,3 +1,4 @@
package foo
object Baz {
implicit val myNr = 1234
}
}