-
Notifications
You must be signed in to change notification settings - Fork 0
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
[WIP] Add TypeApplication synthetics #5
base: synthetic-implicit-conversion
Are you sure you want to change the base?
[WIP] Add TypeApplication synthetics #5
Conversation
Support following synthetics - implicit and context parameters application - Anonymous context param name - Invented given Also convert TypeVar to stripped type, which may appear in synthetics
tests/semanticdb/metac.expect
Outdated
@@ -740,6 +754,10 @@ Occurrences: | |||
[56:6..56:13): TestObj -> endmarkers/TestObj. | |||
[58:4..58:14): endmarkers -> endmarkers/ | |||
|
|||
Synthetics: | |||
[23:7..23:7): => *.apply[Int, Int, Int] | |||
[27:7..27:7): => *.apply[Int, Int, Int] |
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.
synthetic's range should be (1,2,3)
?
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.
it should be (1,2,3) => Tuple2.apply[Int, Int, Int](*)
?? (even in scala2)
Synthetics: | ||
[42:24..42:32):Tag[Int] => *[Int] | ||
[43:28..43:40):Tag[Boolean] => *[Boolean] | ||
[46:28..46:35):C <:< C => *[C, C] |
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.
do we need this?
[49:27..49:31):Refl => *.apply[T] | ||
[52:9..52:13):Refl => *.unapply[Option[B]] | ||
[52:19..52:30):opt.flatMap => *[B] | ||
[52:31..52:50):identity[Option[B]] => *[Function1[A, Option[B]]] |
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.
?
tests/semanticdb/metac.expect
Outdated
[54:14..54:18):Some => *.apply[Some[Int]] | ||
[54:19..54:23):Some => *.apply[Int] | ||
[54:28..54:34):unwrap => *[Some[Int], Int] | ||
[54:34..54:34): => *[Option[Int]] |
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.
what?
[54:19..54:23):Some => *.apply[Int] | ||
[54:28..54:34):unwrap => *[Some[Int], Int] | ||
[54:34..54:34): => *[Option[Int]] | ||
[56:52..56:64):Enum[Planet] => *[Planet] |
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.
?
tests/semanticdb/metac.expect
Outdated
[9:6..9:7): x <- example/Example.x. | ||
[9:10..9:15): scala -> scala/ | ||
[9:16..9:23): reflect -> scala/reflect/ | ||
[9:24..9:32): classTag -> scala/reflect/package.classTag(). | ||
[9:33..9:36): Int -> scala/Int# | ||
|
||
Synthetics: | ||
[5:6..5:41):scala.collection.mutable.Stack[Int] => *[Int] | ||
[5:6..5:41):scala.collection.mutable.Stack[Int] => *[Int] |
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.
why we have type application here
tests/semanticdb/metac.expect
Outdated
@@ -1315,6 +1354,7 @@ Occurrences: | |||
[17:50..17:51): U -> ext/Functor#map().[U] | |||
|
|||
Synthetics: | |||
[4:37..4:37): => *.apply[String, Int] |
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.
tuple apply's range should contains tuple
tests/semanticdb/metac.expect
Outdated
@@ -1398,6 +1439,73 @@ Occurrences: | |||
[40:6..40:7): e -> local9 | |||
[41:6..41:7): f -> local10 | |||
|
|||
Synthetics: | |||
[4:9..4:16):List(1) => *.flatMap[Tuple3[Int, Int, Int]] |
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.
for comprehension shouldn't emit at this moment.
Synthetics: | ||
[12:17..12:25):sayHello => *[Int] | ||
[13:19..13:29):sayGoodbye => *[Int] | ||
[14:18..14:27):saySoLong => *[Int] |
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.
wanna test
extension [A](any: A)
def foo[B] = ...
tests/semanticdb/metac.expect
Outdated
[15:2..15:9):message => augmentString(*) | ||
[17:2..17:2): => *[Tuple2[Int, Int]] |
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.
?
tests/semanticdb/metac.expect
Outdated
[8:2..8:10):(x1, x1) => orderingToOrdered[Tuple2[Int, Int]](*) | ||
[8:2..8:10):(x1, x1) => *(Tuple2(Int, Int)) | ||
[8:3..8:3): => *.apply[Int, Int] | ||
[8:10..8:10): => *[Int, Int] |
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.
suppress revisit
tests/semanticdb/metac.expect
Outdated
@@ -2116,7 +2249,11 @@ Occurrences: | |||
[34:8..34:9): m -> example/Methods#m17.m(). | |||
|
|||
Synthetics: | |||
[3:14..3:26):Methods[Int] => *[Int] |
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.
Methods[Int][Int]
tests/semanticdb/metac.expect
Outdated
@@ -2116,7 +2249,11 @@ Occurrences: | |||
[34:8..34:9): m -> example/Methods#m17.m(). | |||
|
|||
Synthetics: | |||
[3:14..3:26):Methods[Int] => *[Int] | |||
[11:11..11:22):m.List[Int] => *[Int] |
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.
dit
@@ -2866,7 +3003,10 @@ Occurrences: | |||
[32:57..32:59): as -> example/PickOneRefinement_1#run().(as) | |||
|
|||
Synthetics: | |||
[15:23..15:34):elems.toMap => *[String, Any] |
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.
stop revisit
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.
this is not revisit
private[this] val elems: Seq[(String, Any)] @Repeated
private[this] val fields: Map[String, Any] =
Record.this.elems.toMap[String, Any](<:<.refl[(String, Any)])
def selectDynamic(name: String): Any = this.fields.apply(name)
tests/semanticdb/metac.expect
Outdated
@@ -3730,6 +3933,10 @@ Occurrences: | |||
[14:8..14:15): println -> scala/Predef.println(+1). | |||
[17:4..17:7): out -> local0 | |||
|
|||
Synthetics: | |||
[12:5..12:5): => *.apply[Repr[In], Repr[Out]] | |||
[13:12..13:12): => *.unapply[Repr[In], Repr[Out]] |
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.
tuple pattern should have unapply?
tests/semanticdb/metac.expect
Outdated
@@ -4133,6 +4359,12 @@ Occurrences: | |||
[25:27..25:28): t <- local1 | |||
[25:33..25:36): ??? -> scala/Predef.`???`(). | |||
|
|||
Synthetics: | |||
[10:22..10:22): => *[T, U, V] |
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.
this => *[T, U, V]
tests/semanticdb/metac.expect
Outdated
@@ -3730,6 +3924,10 @@ Occurrences: | |||
[14:8..14:15): println -> scala/Predef.println(+1). | |||
[17:4..17:7): out -> local0 | |||
|
|||
Synthetics: | |||
[11:14..11:32):copyImpl[Repr](in) => copyImpl[Repr](*) |
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.
?
edd392e
to
a4f1400
Compare
No description provided.