File tree 1 file changed +17
-6
lines changed
scaladoc/src/dotty/tools/scaladoc/tasty
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,28 @@ object SyntheticsSupport:
22
22
23
23
end extension
24
24
25
+ private def hackExists (using Quotes )(rpos : reflect.Position ) = {
26
+ import reflect ._
27
+ import dotty .tools .dotc
28
+ import dotty .tools .dotc .util .Spans ._
29
+ given dotc .core.Contexts .Context = quotes.asInstanceOf [scala.quoted.runtime.impl.QuotesImpl ].ctx
30
+ val pos = rpos.asInstanceOf [dotc.util.SourcePosition ]
31
+ pos.exists
32
+ }
33
+
25
34
def isSyntheticField (using Quotes )(c : reflect.Symbol ) =
26
35
import reflect ._
27
36
c.flags.is(Flags .CaseAccessor ) || (c.flags.is(Flags .Module ) && ! c.flags.is(Flags .Given ))
28
37
29
38
def constructorWithoutParamLists (using Quotes )(c : reflect.ClassDef ): Boolean =
30
- c.constructor.pos.start == c.constructor.pos.end || {
31
- val end = c.constructor.pos.end
32
- val typesEnd = c.constructor.leadingTypeParams.lastOption.fold(end - 1 )(_.pos.end)
33
- val classDefTree = c.constructor.show
34
- c.constructor.leadingTypeParams.nonEmpty && end <= typesEnd + 1
35
- }
39
+ if hackExists(c.constructor.pos) then {
40
+ c.constructor.pos.start == c.constructor.pos.end || {
41
+ val end = c.constructor.pos.end
42
+ val typesEnd = c.constructor.leadingTypeParams.lastOption.fold(end - 1 )(_.pos.end)
43
+ val classDefTree = c.constructor.show
44
+ c.constructor.leadingTypeParams.nonEmpty && end <= typesEnd + 1
45
+ }
46
+ } else false
36
47
37
48
def getSupertypes (using Quotes )(c : reflect.ClassDef ) =
38
49
c.symbol.typeRef.baseClasses.map(b => b -> c.symbol.typeRef.baseType(b)).tail
You can’t perform that action at this time.
0 commit comments