-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scaladoc: new heuristic for extension method parameter extraction #14810
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
Sporarum
merged 12 commits into
scala:main
from
rochala:extension-method-doc-new-heuristic
Jan 5, 2023
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
136c078
add new heuristic to better split extension methods with implicits
rochala d1ca544
remove trailing whitespace
rochala 22edae8
add null safety for Option extraction
rochala 349739e
Add signature tests to test suite
pikinier20 2f31cba
remove Try for assert failure, fix unchecked casts
rochala 567a0d6
remove trailing whitespaces
rochala 4556c16
Filter positions with nonexistent spans
pikinier20 d32e4a9
Proper fix of unexisting positions check
pikinier20 6cdc381
Fix signature generation in searchbar data
pikinier20 53a411a
Revert style of top-level entries. Fix styling issues in side menu
rochala c34bf34
revert changes and NoPosition fix
rochala 6a12242
delete unnecesary css
rochala 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 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,22 +1,54 @@ | ||
package tests.extensionParams | ||
|
||
trait Animal | ||
|
||
extension [A](thiz: A) | ||
def toTuple2[B](that: B): (A, B) = thiz -> that | ||
def toTuple2[B](that: B): (A, B) | ||
= thiz -> that | ||
|
||
extension [A](a: A)(using Int) | ||
def f[B](b: B): (A, B) = ??? | ||
def f1[B](b: B): (A, B) | ||
= ??? | ||
|
||
extension [A](a: A)(using Int) | ||
def ff(b: A): (A, A) = ??? | ||
def f2(b: A): (A, A) | ||
= ??? | ||
|
||
extension [A](a: A)(using Int) | ||
def fff(using String)(b: A): (A, A) = ??? | ||
def f3(using String)(b: A): (A, A) | ||
= ??? | ||
|
||
extension (a: Char)(using Int) | ||
def ffff(using String)(b: Int): Unit = ??? | ||
def f4(using String)(b: Int): Unit | ||
= ??? | ||
|
||
extension (a: Char)(using Int) | ||
def fffff[B](using String)(b: B): Unit = ??? | ||
def f5[B](using String)(b: B): Unit | ||
= ??? | ||
|
||
extension [A <: List[Char]](a: Int)(using Int) | ||
def f6[B](b: B): (A, B) | ||
= ??? | ||
|
||
extension [A <: List[Char]](using String)(using Unit)(a: A)(using Int)(using Number) | ||
def f7[B, C](b: B)(c: C): (A, B) | ||
= ??? | ||
|
||
extension [A <: List[Char]](using String)(using Unit)(a: A)(using Int)(using Number) | ||
def f8(b: Any)(c: Any): Any | ||
= ??? | ||
|
||
extension [A <: List[Char]](using String)(using Unit)(a: A)(using Int)(using Number) | ||
def f9[B, C](using Int)(b: B)(c: C): (A, B) | ||
= ??? | ||
|
||
extension [A <: List[Char]](using String)(using Unit)(a: A)(using Int)(using Number) | ||
def f10(using Int)(b: Any)(c: Any): Any | ||
= ??? | ||
|
||
def f12(using Int)(b: A)(c: String): Number | ||
= ??? | ||
|
||
extension [A <: List[Char]](a: A)(using Int) | ||
def ffffff[B](b: B): (A, B) = ??? | ||
extension (using String)(using Unit)(a: Animal)(using Int)(using Number) | ||
def f11(b: Any)(c: Any): Any | ||
= ??? | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these tests work? I see test “fixtures” but no test specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had answered in person, but I'll put it here for posterity:
This works by comparing the text of the file with the output of scala-meta, similarly to what is done in the compiler with the
tests/pos
,tests/neg
folders.This is therefore both the declaration and the specification for the tests !