-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix #12981 add REPL show diagnostics level warn | err #13000
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 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4a280c5
add show diagnostics level in REPL warn | err
bjornregnell 095da6c
fix white space
bjornregnell 7dbdcb4
remove trailing blank
bjornregnell 542e669
manually tweak first bulk of repl tests failing
bjornregnell b605c03
add util to modify repl tests
bjornregnell 05a454a
run utility and then manually tweak Warning
bjornregnell 0a5e01d
update ShadowingTests add "-- Error:"
bjornregnell 1da59b1
make util recursively traverse dirs
bjornregnell 1778dc7
fix indent, capture diff value
bjornregnell e83c2f1
remove update util
bjornregnell e1b51e0
Update compiler/src/dotty/tools/repl/Rendering.scala
bjornregnell 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
scala> object Foo { val bar = new Object { def baz = 1 }; bar.baz } | ||
-- Error: | ||
1 | object Foo { val bar = new Object { def baz = 1 }; bar.baz } | ||
| ^^^^^^^ | ||
| value baz is not a member of Object |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
scala> object Lives { class Private { def foo1: Any = new Private.C1; def foo2: Any = new Private.C2 }; object Private { class C1 private {}; private class C2 {} } } | ||
-- Error: | ||
1 | object Lives { class Private { def foo1: Any = new Private.C1; def foo2: Any = new Private.C2 }; object Private { class C1 private {}; private class C2 {} } } | ||
| ^^^^^^^^^^ | ||
|constructor C1 cannot be accessed as a member of Lives.Private.C1 from class Private. |
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
scala> class Foo extends Bar // with one tab | ||
-- Error: | ||
1 | class Foo extends Bar // with one tab | ||
| ^^^ | ||
| Not found: type Bar | ||
scala> class Foo extends Bar // with spaces | ||
-- Error: | ||
1 | class Foo extends Bar // with spaces | ||
| ^^^ | ||
| Not found: type Bar | ||
scala> class Foo extends Bar // with tabs | ||
-- Error: | ||
1 | class Foo extends Bar // with tabs | ||
| ^^^ | ||
| Not found: type Bar |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
scala> def x | ||
-- Error: | ||
1 | def x | ||
| ^ | ||
| Missing return type | ||
|
||
scala> def x: Int | ||
-- Error: | ||
1 | def x: Int | ||
| ^ | ||
|Declaration of method x not allowed here: only classes can have declared but undefined members |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
scala> class Foo(x : Any) { val foo : Integer = 0; def this() = { this(foo) } } | ||
-- Error: | ||
1 | class Foo(x : Any) { val foo : Integer = 0; def this() = { this(foo) } } | ||
| ^^^ | ||
| foo is not accessible from constructor arguments |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
scala> abstract class F { def f(arg: Any): Unit; override def toString = "F" } | ||
// defined class F | ||
scala> val f: F = println | ||
-- Warning: | ||
1 | val f: F = println | ||
| ^^^^^^^ | ||
|method println is eta-expanded even though F does not have the @FunctionalInterface annotation. | ||
val f: F = F | ||
val f: F = F |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
scala> xml" | ||
-- Error: | ||
1 | xml" | ||
| ^ | ||
| unclosed string literal | ||
scala> xml"" | ||
-- Error: | ||
1 | xml"" | ||
| ^^^^^ | ||
| value xml is not a member of StringContext | ||
scala> xml""" | ||
-- Error: | ||
1 | xml""" | ||
| ^ | ||
| unclosed multi-line string literal | ||
-- Error: | ||
1 | xml""" | ||
| ^ | ||
| unclosed multi-line string literal | ||
scala> s" | ||
-- Error: | ||
1 | s" | ||
| ^ | ||
| unclosed string literal |
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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
scala> class T extends CanEqual | ||
-- Error: | ||
1 | class T extends CanEqual | ||
| ^ | ||
| Cannot extend sealed trait CanEqual in a different source file | ||
-- Error: | ||
1 | class T extends CanEqual | ||
| ^^^^^^^^ | ||
| Missing type parameter for CanEqual | ||
scala> class T extends CanEqual | ||
-- Error: | ||
1 | class T extends CanEqual | ||
| ^ | ||
| Cannot extend sealed trait CanEqual in a different source file | ||
-- Error: | ||
1 | class T extends CanEqual | ||
| ^^^^^^^^ | ||
| Missing type parameter for CanEqual |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
scala> Foo | ||
-- Error: | ||
1 | Foo | ||
| ^^^ | ||
| Not found: Foo | ||
scala> Bar | ||
-- Error: | ||
1 | Bar | ||
| ^^^ | ||
| Not found: Bar | ||
| Not found: Bar |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
scala> class B { override def foo(i: Int): Unit = {}; } | ||
-- Error: | ||
1 | class B { override def foo(i: Int): Unit = {}; } | ||
| ^ | ||
| method foo overrides nothing | ||
scala> class A { def foo: Unit = {}; } | ||
// defined class A | ||
scala> class B extends A { override def foo(i: Int): Unit = {}; } | ||
-- Error: | ||
1 | class B extends A { override def foo(i: Int): Unit = {}; } | ||
| ^ | ||
| method foo has a different signature than the overridden declaration |
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
scala> ; | ||
scala> ;; | ||
scala> 1; 2 | ||
scala> ; | ||
scala> ;; | ||
scala> 1; 2 | ||
val res0: Int = 1 | ||
val res1: Int = 2 | ||
scala> 1; | ||
scala> 1; | ||
val res2: Int = 1 | ||
scala> 1;; 2 | ||
scala> 1;; 2 | ||
val res3: Int = 1 | ||
val res4: Int = 2 | ||
scala> } | ||
scala> } | ||
-- Error: | ||
1 | } | ||
| ^ | ||
| eof expected, but '}' found |
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
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.