-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add DisambiguationFormatter that expand diff form to include type sym…
…bol of both sides yield to identical Formatted form no test yet
- Loading branch information
Showing
5 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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
8 changes: 8 additions & 0 deletions
8
core/src/test/resources/splain/plugin/DiffDisambiguationSpec/__direct/check
This file contains 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,8 @@ | ||
newSource1.scala:6: error: type mismatch; | ||
Long {in <none>}|Long {in scala} | ||
else add2(x.head, y.head) :: add(x.tail, y.tail) | ||
^ | ||
newSource1.scala:6: error: type mismatch; | ||
Long {in <none>}|Long {in scala} | ||
else add2(x.head, y.head) :: add(x.tail, y.tail) | ||
^ |
19 changes: 19 additions & 0 deletions
19
core/src/test/scala/splain/plugin/DiffDisambiguationSpec.scala
This file contains 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,19 @@ | ||
package splain.plugin | ||
|
||
import splain.SpecBase | ||
|
||
class DiffDisambiguationSpec extends SpecBase.Direct { | ||
|
||
final val basic = | ||
""" | ||
object Test { | ||
def add2(x:Long,y:Long): Long = x + y | ||
def add[Long](x: List[Long], y: List[Long]): List[Long] = | ||
if (x.isEmpty || y.isEmpty) Nil | ||
else add2(x.head, y.head) :: add(x.tail, y.tail) | ||
} | ||
""" | ||
|
||
check(basic, numberOfErrors = 2) | ||
} |