Skip to content

Commit

Permalink
reduce some warnings in semanticdb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Jul 14, 2023
1 parent 2b02d38 commit 2f65f35
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/semanticdb/expect/Enums.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Enums:
enum <:<[-A, B]:
case Refl[C]() extends (C <:< C)

object <:< :
object `<:<`:
given [T]: (T <:< T) = Refl()

extension [A, B](opt: Option[A]) def unwrap(using ev: A <:< Option[B]): Option[B] = ev match
Expand Down
3 changes: 2 additions & 1 deletion tests/semanticdb/expect/Givens.expect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ object Givens/*<-a::b::Givens.*/:
def empty/*<-a::b::Givens.given_Monoid_String.empty().*/ = ""
extension (x/*<-a::b::Givens.given_Monoid_String.combine().(x)*/: String/*->scala::Predef.String#*/) def combine/*<-a::b::Givens.given_Monoid_String.combine().*/(y/*<-a::b::Givens.given_Monoid_String.combine().(y)*/: String/*->scala::Predef.String#*/) = x/*->a::b::Givens.given_Monoid_String.combine().(x)*/ +/*->java::lang::String#`+`().*/ y/*->a::b::Givens.given_Monoid_String.combine().(y)*/

inline given int2String/*<-a::b::Givens.int2String().*/: Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] = _.toString/*->scala::Any#toString().*/
inline given int2String/*<-a::b::Givens.int2String().*/: Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] with
def apply/*<-a::b::Givens.int2String#apply().*/(x/*<-a::b::Givens.int2String#apply().(x)*/: Int/*->scala::Int#*/): String/*->scala::Predef.String#*/ = x/*->a::b::Givens.int2String#apply().(x)*/.toString/*->scala::Any#toString().*/

def foo/*<-a::b::Givens.foo().*/[A/*<-a::b::Givens.foo().[A]*/](using A/*<-a::b::Givens.foo().(A)*/: Monoid/*->a::b::Givens.Monoid#*/[A/*->a::b::Givens.foo().[A]*/]): A/*->a::b::Givens.foo().[A]*/ = A/*->a::b::Givens.foo().(A)*/.combine/*->a::b::Givens.Monoid#combine().*/(A/*->a::b::Givens.foo().(A)*/.empty/*->a::b::Givens.Monoid#empty().*/)(A/*->a::b::Givens.foo().(A)*/.empty/*->a::b::Givens.Monoid#empty().*/)
3 changes: 2 additions & 1 deletion tests/semanticdb/expect/Givens.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ object Givens:
def empty = ""
extension (x: String) def combine(y: String) = x + y

inline given int2String: Conversion[Int, String] = _.toString
inline given int2String: Conversion[Int, String] with
def apply(x: Int): String = x.toString

def foo[A](using A: Monoid[A]): A = A.combine(A.empty)(A.empty)
45 changes: 27 additions & 18 deletions tests/semanticdb/metac.expect
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Occurrences:
[46:28..46:29): C -> _empty_/Enums.`<:<`.Refl#[C]
[46:30..46:33): <:< -> _empty_/Enums.`<:<`#
[46:34..46:35): C -> _empty_/Enums.`<:<`.Refl#[C]
[48:9..48:12): <:< <- _empty_/Enums.`<:<`.
[48:10..48:13): <:< <- _empty_/Enums.`<:<`.
[49:11..49:12): T <- _empty_/Enums.`<:<`.`given_<:<_T_T`().[T]
[49:16..49:17): T -> _empty_/Enums.`<:<`.`given_<:<_T_T`().[T]
[49:18..49:21): <:< -> _empty_/Enums.`<:<`#
Expand Down Expand Up @@ -1588,12 +1588,12 @@ Schema => SemanticDB v4
Uri => Givens.scala
Text => empty
Language => Scala
Symbols => 29 entries
Occurrences => 65 entries
Symbols => 33 entries
Occurrences => 70 entries
Synthetics => 3 entries

Symbols:
a/b/Givens. => final object Givens extends Object { self: Givens.type => +12 decls }
a/b/Givens. => final object Givens extends Object { self: Givens.type => +13 decls }
a/b/Givens.Monoid# => trait Monoid [typeparam A ] extends Object { self: Monoid[A] => +4 decls }
a/b/Givens.Monoid#[A] => typeparam A
a/b/Givens.Monoid#`<init>`(). => primary ctor <init> [typeparam A ](): Monoid[A]
Expand All @@ -1611,7 +1611,11 @@ a/b/Givens.given_Monoid_String.combine().(y) => param y: String
a/b/Givens.given_Monoid_String.empty(). => method empty => String <: a/b/Givens.Monoid#empty().
a/b/Givens.goodbye1. => val method goodbye1 String
a/b/Givens.hello1. => val method hello1 String
a/b/Givens.int2String(). => final implicit given inline macro int2String => Conversion[Int, String]
a/b/Givens.int2String# => implicit given class int2String extends Conversion[Int, String] { self: int2String => +2 decls }
a/b/Givens.int2String#`<init>`(). => primary ctor <init> (): int2String
a/b/Givens.int2String#apply(). => method apply (param x: Int): String <: scala/Conversion#apply()., scala/Function1#apply().
a/b/Givens.int2String#apply().(x) => param x: Int
a/b/Givens.int2String(). => final implicit given inline macro int2String => int2String
a/b/Givens.sayGoodbye(). => method sayGoodbye [typeparam B ](param any: B): String
a/b/Givens.sayGoodbye().(any) => param any: B
a/b/Givens.sayGoodbye().[B] => typeparam B
Expand Down Expand Up @@ -1676,19 +1680,24 @@ Occurrences:
[24:27..24:37): Conversion -> scala/Conversion#
[24:38..24:41): Int -> scala/Int#
[24:43..24:49): String -> scala/Predef.String#
[24:55..24:63): toString -> scala/Any#toString().
[26:6..26:9): foo <- a/b/Givens.foo().
[26:10..26:11): A <- a/b/Givens.foo().[A]
[26:19..26:20): A <- a/b/Givens.foo().(A)
[26:22..26:28): Monoid -> a/b/Givens.Monoid#
[26:29..26:30): A -> a/b/Givens.foo().[A]
[26:34..26:35): A -> a/b/Givens.foo().[A]
[26:38..26:39): A -> a/b/Givens.foo().(A)
[26:40..26:47): combine -> a/b/Givens.Monoid#combine().
[26:48..26:49): A -> a/b/Givens.foo().(A)
[26:50..26:55): empty -> a/b/Givens.Monoid#empty().
[26:57..26:58): A -> a/b/Givens.foo().(A)
[26:59..26:64): empty -> a/b/Givens.Monoid#empty().
[25:8..25:13): apply <- a/b/Givens.int2String#apply().
[25:14..25:15): x <- a/b/Givens.int2String#apply().(x)
[25:17..25:20): Int -> scala/Int#
[25:23..25:29): String -> scala/Predef.String#
[25:32..25:33): x -> a/b/Givens.int2String#apply().(x)
[25:34..25:42): toString -> scala/Any#toString().
[27:6..27:9): foo <- a/b/Givens.foo().
[27:10..27:11): A <- a/b/Givens.foo().[A]
[27:19..27:20): A <- a/b/Givens.foo().(A)
[27:22..27:28): Monoid -> a/b/Givens.Monoid#
[27:29..27:30): A -> a/b/Givens.foo().[A]
[27:34..27:35): A -> a/b/Givens.foo().[A]
[27:38..27:39): A -> a/b/Givens.foo().(A)
[27:40..27:47): combine -> a/b/Givens.Monoid#combine().
[27:48..27:49): A -> a/b/Givens.foo().(A)
[27:50..27:55): empty -> a/b/Givens.Monoid#empty().
[27:57..27:58): A -> a/b/Givens.foo().(A)
[27:59..27:64): empty -> a/b/Givens.Monoid#empty().

Synthetics:
[12:17..12:25):sayHello => *[Int]
Expand Down

0 comments on commit 2f65f35

Please sign in to comment.