From 2f65f35ed613bf5d1cffb41d331b9e3dc73158ae Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Fri, 14 Jul 2023 12:33:39 +0200 Subject: [PATCH] reduce some warnings in semanticdb tests --- tests/semanticdb/expect/Enums.scala | 2 +- tests/semanticdb/expect/Givens.expect.scala | 3 +- tests/semanticdb/expect/Givens.scala | 3 +- tests/semanticdb/metac.expect | 45 ++++++++++++--------- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/tests/semanticdb/expect/Enums.scala b/tests/semanticdb/expect/Enums.scala index be7e2d6ce5cb..7647c9cafeb7 100644 --- a/tests/semanticdb/expect/Enums.scala +++ b/tests/semanticdb/expect/Enums.scala @@ -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 diff --git a/tests/semanticdb/expect/Givens.expect.scala b/tests/semanticdb/expect/Givens.expect.scala index 5d7a9f5dc798..8ee82a419435 100644 --- a/tests/semanticdb/expect/Givens.expect.scala +++ b/tests/semanticdb/expect/Givens.expect.scala @@ -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().*/) diff --git a/tests/semanticdb/expect/Givens.scala b/tests/semanticdb/expect/Givens.scala index 819d70cfadca..f0a56e624d5d 100644 --- a/tests/semanticdb/expect/Givens.scala +++ b/tests/semanticdb/expect/Givens.scala @@ -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) diff --git a/tests/semanticdb/metac.expect b/tests/semanticdb/metac.expect index 6a4094ca1505..9dc65f2b24ea 100644 --- a/tests/semanticdb/metac.expect +++ b/tests/semanticdb/metac.expect @@ -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.`<:<`# @@ -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#``(). => primary ctor [typeparam A ](): Monoid[A] @@ -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#``(). => primary ctor (): 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 @@ -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]