-
Notifications
You must be signed in to change notification settings - Fork 1.1k
test symboo.defTree for symbols from Tasty #7036
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8e5ea1e
Add compiler phases to set and unset symbol.defTree
liufengyun c8c598f
test symbol.defTree
liufengyun d93e7c0
update Analyzer
liufengyun f4f525d
update test code
liufengyun f3de3b6
disable SetDefTreeOff
liufengyun 31d13c4
Add plugin test to normal CI
liufengyun 4e8bb42
change runsAfter of SetDefTree
liufengyun b590d93
revert changes in PostTyper
liufengyun 28db2aa
Fix CI
liufengyun 30c9e3e
Revert changes to compiler
liufengyun 8978c6b
Check invariant about the flags of pattern-bound symbols
liufengyun 2b21ab4
Address review: add a note to code
liufengyun 791c75a
Reduced inline match symbols should not have Case
liufengyun e5a4b3e
Pattern bound symbols should have Case flag
liufengyun 9a629c3
Add Symbol.isPatternBound
liufengyun 1d7e79d
address review
liufengyun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
42 changes: 42 additions & 0 deletions
42
sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/app/Hello.scala
This file contains hidden or 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,42 @@ | ||
package hello | ||
|
||
import lib._ | ||
|
||
case class Student(name: String) | ||
|
||
class M(val n: Int) { | ||
val a = 30 * n | ||
def this(c: Char) = this(c.toInt) | ||
|
||
class B(x: Int) { | ||
def this(c: Char) = this(c.toInt) | ||
val b = x * a | ||
def bar(i: Int) = i * x | ||
} | ||
|
||
def foo(i: Int) = i * n | ||
|
||
def bar = { | ||
class C(val s: String) | ||
val c = new C("hello") | ||
def qux = c.s | ||
qux | ||
} | ||
} | ||
|
||
|
||
object Test { | ||
def testLib: Unit = { | ||
val a: A = new A(30) | ||
val b: a.B = new a.B(24) | ||
a.foo(3) | ||
b.bar(9) | ||
} | ||
|
||
def testHello: Unit = { | ||
val a: M = new M(30) | ||
val b: a.B = new a.B(24) | ||
a.foo(3) | ||
b.bar(9) | ||
} | ||
} |
This file contains hidden or 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,27 @@ | ||
lazy val dottyVersion = sys.props("plugin.scalaVersion") | ||
|
||
lazy val plugin = project | ||
.in(file("plugin")) | ||
.settings( | ||
name := "init-checker", | ||
version := "0.0.1", | ||
organization := "ch.epfl.lamp", | ||
scalaVersion := dottyVersion, | ||
|
||
libraryDependencies ++= Seq( | ||
"ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" | ||
) | ||
) | ||
|
||
lazy val lib = project | ||
.in(file("lib")) | ||
.settings( | ||
scalaVersion := dottyVersion | ||
) | ||
|
||
lazy val app = project | ||
.in(file("app")) | ||
.settings( | ||
scalaVersion := dottyVersion | ||
) | ||
.dependsOn(lib) |
28 changes: 28 additions & 0 deletions
28
sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt
This file contains hidden or 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,28 @@ | ||
lazy val dottyVersion = sys.props("plugin.scalaVersion") | ||
|
||
lazy val plugin = project | ||
.in(file("plugin")) | ||
.settings( | ||
name := "init-checker", | ||
version := "0.0.1", | ||
organization := "ch.epfl.lamp", | ||
scalaVersion := dottyVersion, | ||
|
||
libraryDependencies ++= Seq( | ||
"ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" | ||
) | ||
) | ||
|
||
lazy val lib = project | ||
.in(file("lib")) | ||
.settings( | ||
scalaVersion := dottyVersion | ||
) | ||
|
||
lazy val app = project | ||
.in(file("app")) | ||
.settings( | ||
scalaVersion := dottyVersion, | ||
addCompilerPlugin("ch.epfl.lamp" %% "init-checker" % "0.0.1") | ||
) | ||
.dependsOn(lib) |
29 changes: 29 additions & 0 deletions
29
sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt
This file contains hidden or 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,29 @@ | ||
lazy val dottyVersion = sys.props("plugin.scalaVersion") | ||
|
||
lazy val plugin = project | ||
.in(file("plugin")) | ||
.settings( | ||
name := "init-checker", | ||
version := "0.0.1", | ||
organization := "ch.epfl.lamp", | ||
scalaVersion := dottyVersion, | ||
|
||
libraryDependencies ++= Seq( | ||
"ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" | ||
) | ||
) | ||
|
||
lazy val lib = project | ||
.in(file("lib")) | ||
.settings( | ||
scalaVersion := dottyVersion | ||
) | ||
|
||
lazy val app = project | ||
.in(file("app")) | ||
.settings( | ||
scalaVersion := dottyVersion, | ||
scalacOptions += "-Yretain-trees", | ||
addCompilerPlugin("ch.epfl.lamp" %% "init-checker" % "0.0.1") | ||
) | ||
.dependsOn(lib) |
17 changes: 17 additions & 0 deletions
17
sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/lib/Lib.scala
This file contains hidden or 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,17 @@ | ||
package lib | ||
|
||
class A(val n: Int) { | ||
def this(c: Char) = this(c.toInt) | ||
|
||
val a = 30 * n | ||
|
||
class B(x: Int) { | ||
def this(c: Char) = this(c.toInt) | ||
val b = x * a | ||
def bar(i: Int) = i * x | ||
} | ||
|
||
def foo(i: Int) = i * n | ||
} | ||
|
||
case class Product(name: String, price: Int) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.