Skip to content

Commit 863cf1d

Browse files
committed
fix case class definitions
1 parent f11c8ff commit 863cf1d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package example
2-
/*
2+
33
class CaseTest {
44
def foo (x: Option[Int]) : Int =
55
x match {
66
case y @ Some(x) => x
77
case None => 0
88
}
99
}
10-
*/
10+
1111
case class CaseClass(x: Int)
12-
//case object CaseObject
12+
case object CaseObject

semanticdb/input/src/main/scala/example/Example.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Example {
1515
y
1616
)
1717
}
18-
/*
18+
1919
class ExampleInit {
2020

21-
}*/
21+
}

semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
669669
fittedInitClassRange = None
670670

671671
// we add the parents to the symbol list
672-
forceAddBecauseParents = true
672+
forceAddBecauseParents = !(tree.symbol.flags.is(Flags.Case))
673673
parents.foreach(_ match {
674674
case IsTypeTree(t) => traverseTypeTree(t)
675675
case IsTerm(t) => {

semanticdb/test/dotty/semanticdb/Tests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class Tests {
214214
//@Test def testAnonymous(): Unit = checkFile("example/Anonymous.scala")
215215
//@Test def testDottyPredef(): Unit = checkFile("example/DottyPredef.scala")
216216
@Test def testCase(): Unit = checkFile("example/Case.scala")
217+
@Test def teastCase(): Unit = checkFile("example/Example.scala")
217218

218219

219220
}

0 commit comments

Comments
 (0)