Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
github-sebastien-boulet committed Oct 19, 2020
1 parent 6a842ae commit 35d1ba6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object DisableSyntaxMoreRules {

class Foo {
def bar(x: Int = 42) = 1 /* assert: DisableSyntax.defaultArgs
^
^^
Default args makes it hard to use methods as functions.
*/
}
Expand Down Expand Up @@ -58,11 +58,11 @@ Default args makes it hard to use methods as functions.

class Bar { type Foo = Int; def foo = 42 }
def foo(a: { type Foo = Int; def foo: Foo } = new Bar): Int = a.foo /* assert: DisableSyntax.defaultArgs
^
^^^^^^^
Default args makes it hard to use methods as functions.
*/
def foo2(a: { type Foo = Int; def foo: Foo } = {val a = new Bar; a}): Int = a.foo /* assert: DisableSyntax.defaultArgs
^
^^^^^^^^^^^^^^^^^^^^
Default args makes it hard to use methods as functions.
*/

Expand Down
2 changes: 1 addition & 1 deletion scalafix-tests/input/src/main/scala/test/NoFinalize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ case object NoFinalize {

class Example {
override protected def finalize() = () /* assert: DisableSyntax.noFinalize
^
^^^^^^^^
finalize should not be used
*/
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ case object DisableSyntaxBase {


null /* assert: DisableSyntax.null
^
^^^^
null should be avoided, consider using Option instead
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ case object DisableSyntaxNoValPatterns {
val (works6, _) = (1, Left(42))
case class TestClass(a: Int, b: Int)
val TestClass(a, b) = TestClass(1, 1) /* assert: DisableSyntax.noValPatterns
^
^^^^^^^^^^^^^^^
Pattern matching in val assignment can result in match error, use "_ match { ... }" with a fallback case instead.*/
val TestClass(c, _) = TestClass(1, 1) /* assert: DisableSyntax.noValPatterns
^
^^^^^^^^^^^^^^^
Pattern matching in val assignment can result in match error, use "_ match { ... }" with a fallback case instead.*/
}

0 comments on commit 35d1ba6

Please sign in to comment.