Skip to content

Commit 2f65f35

Browse files
committed
reduce some warnings in semanticdb tests
1 parent 2b02d38 commit 2f65f35

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

tests/semanticdb/expect/Enums.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ object Enums:
4646
enum <:<[-A, B]:
4747
case Refl[C]() extends (C <:< C)
4848

49-
object <:< :
49+
object `<:<`:
5050
given [T]: (T <:< T) = Refl()
5151

5252
extension [A, B](opt: Option[A]) def unwrap(using ev: A <:< Option[B]): Option[B] = ev match

tests/semanticdb/expect/Givens.expect.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ object Givens/*<-a::b::Givens.*/:
2222
def empty/*<-a::b::Givens.given_Monoid_String.empty().*/ = ""
2323
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)*/
2424

25-
inline given int2String/*<-a::b::Givens.int2String().*/: Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] = _.toString/*->scala::Any#toString().*/
25+
inline given int2String/*<-a::b::Givens.int2String().*/: Conversion/*->scala::Conversion#*/[Int/*->scala::Int#*/, String/*->scala::Predef.String#*/] with
26+
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().*/
2627

2728
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().*/)

tests/semanticdb/expect/Givens.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ object Givens:
2222
def empty = ""
2323
extension (x: String) def combine(y: String) = x + y
2424

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

2728
def foo[A](using A: Monoid[A]): A = A.combine(A.empty)(A.empty)

tests/semanticdb/metac.expect

+27-18
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ Occurrences:
12421242
[46:28..46:29): C -> _empty_/Enums.`<:<`.Refl#[C]
12431243
[46:30..46:33): <:< -> _empty_/Enums.`<:<`#
12441244
[46:34..46:35): C -> _empty_/Enums.`<:<`.Refl#[C]
1245-
[48:9..48:12): <:< <- _empty_/Enums.`<:<`.
1245+
[48:10..48:13): <:< <- _empty_/Enums.`<:<`.
12461246
[49:11..49:12): T <- _empty_/Enums.`<:<`.`given_<:<_T_T`().[T]
12471247
[49:16..49:17): T -> _empty_/Enums.`<:<`.`given_<:<_T_T`().[T]
12481248
[49:18..49:21): <:< -> _empty_/Enums.`<:<`#
@@ -1588,12 +1588,12 @@ Schema => SemanticDB v4
15881588
Uri => Givens.scala
15891589
Text => empty
15901590
Language => Scala
1591-
Symbols => 29 entries
1592-
Occurrences => 65 entries
1591+
Symbols => 33 entries
1592+
Occurrences => 70 entries
15931593
Synthetics => 3 entries
15941594

15951595
Symbols:
1596-
a/b/Givens. => final object Givens extends Object { self: Givens.type => +12 decls }
1596+
a/b/Givens. => final object Givens extends Object { self: Givens.type => +13 decls }
15971597
a/b/Givens.Monoid# => trait Monoid [typeparam A ] extends Object { self: Monoid[A] => +4 decls }
15981598
a/b/Givens.Monoid#[A] => typeparam A
15991599
a/b/Givens.Monoid#`<init>`(). => primary ctor <init> [typeparam A ](): Monoid[A]
@@ -1611,7 +1611,11 @@ a/b/Givens.given_Monoid_String.combine().(y) => param y: String
16111611
a/b/Givens.given_Monoid_String.empty(). => method empty => String <: a/b/Givens.Monoid#empty().
16121612
a/b/Givens.goodbye1. => val method goodbye1 String
16131613
a/b/Givens.hello1. => val method hello1 String
1614-
a/b/Givens.int2String(). => final implicit given inline macro int2String => Conversion[Int, String]
1614+
a/b/Givens.int2String# => implicit given class int2String extends Conversion[Int, String] { self: int2String => +2 decls }
1615+
a/b/Givens.int2String#`<init>`(). => primary ctor <init> (): int2String
1616+
a/b/Givens.int2String#apply(). => method apply (param x: Int): String <: scala/Conversion#apply()., scala/Function1#apply().
1617+
a/b/Givens.int2String#apply().(x) => param x: Int
1618+
a/b/Givens.int2String(). => final implicit given inline macro int2String => int2String
16151619
a/b/Givens.sayGoodbye(). => method sayGoodbye [typeparam B ](param any: B): String
16161620
a/b/Givens.sayGoodbye().(any) => param any: B
16171621
a/b/Givens.sayGoodbye().[B] => typeparam B
@@ -1676,19 +1680,24 @@ Occurrences:
16761680
[24:27..24:37): Conversion -> scala/Conversion#
16771681
[24:38..24:41): Int -> scala/Int#
16781682
[24:43..24:49): String -> scala/Predef.String#
1679-
[24:55..24:63): toString -> scala/Any#toString().
1680-
[26:6..26:9): foo <- a/b/Givens.foo().
1681-
[26:10..26:11): A <- a/b/Givens.foo().[A]
1682-
[26:19..26:20): A <- a/b/Givens.foo().(A)
1683-
[26:22..26:28): Monoid -> a/b/Givens.Monoid#
1684-
[26:29..26:30): A -> a/b/Givens.foo().[A]
1685-
[26:34..26:35): A -> a/b/Givens.foo().[A]
1686-
[26:38..26:39): A -> a/b/Givens.foo().(A)
1687-
[26:40..26:47): combine -> a/b/Givens.Monoid#combine().
1688-
[26:48..26:49): A -> a/b/Givens.foo().(A)
1689-
[26:50..26:55): empty -> a/b/Givens.Monoid#empty().
1690-
[26:57..26:58): A -> a/b/Givens.foo().(A)
1691-
[26:59..26:64): empty -> a/b/Givens.Monoid#empty().
1683+
[25:8..25:13): apply <- a/b/Givens.int2String#apply().
1684+
[25:14..25:15): x <- a/b/Givens.int2String#apply().(x)
1685+
[25:17..25:20): Int -> scala/Int#
1686+
[25:23..25:29): String -> scala/Predef.String#
1687+
[25:32..25:33): x -> a/b/Givens.int2String#apply().(x)
1688+
[25:34..25:42): toString -> scala/Any#toString().
1689+
[27:6..27:9): foo <- a/b/Givens.foo().
1690+
[27:10..27:11): A <- a/b/Givens.foo().[A]
1691+
[27:19..27:20): A <- a/b/Givens.foo().(A)
1692+
[27:22..27:28): Monoid -> a/b/Givens.Monoid#
1693+
[27:29..27:30): A -> a/b/Givens.foo().[A]
1694+
[27:34..27:35): A -> a/b/Givens.foo().[A]
1695+
[27:38..27:39): A -> a/b/Givens.foo().(A)
1696+
[27:40..27:47): combine -> a/b/Givens.Monoid#combine().
1697+
[27:48..27:49): A -> a/b/Givens.foo().(A)
1698+
[27:50..27:55): empty -> a/b/Givens.Monoid#empty().
1699+
[27:57..27:58): A -> a/b/Givens.foo().(A)
1700+
[27:59..27:64): empty -> a/b/Givens.Monoid#empty().
16921701

16931702
Synthetics:
16941703
[12:17..12:25):sayHello => *[Int]

0 commit comments

Comments
 (0)