File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -3113,15 +3113,13 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
31133113 * parameters of the current class are also defined.
31143114 */
31153115 def implementDeferredGivens (body : List [Tree ]): List [Tree ] =
3116- def isGivenValue (mbr : TermRef ) =
3117- val dcl = mbr.symbol
3118- if dcl.is(Method ) then
3119- report.error(
3120- em """ Cannot infer the implementation of the deferred ${dcl.showLocated}
3121- |since that given is parameterized. An implementing given needs to be written explicitly. """ ,
3122- cdef.srcPos)
3123- false
3124- else true
3116+ def failFor (mbr : TermRef , why : String ): false =
3117+ report.error(
3118+ em """ Cannot infer the implementation of the deferred ${mbr.symbol.showLocated}
3119+ |since $why. An implementing given needs to be written explicitly. """ ,
3120+ cdef.srcPos)
3121+ false
3122+ def isGivenValue (mbr : TermRef ) = ! mbr.symbol.is(Method ) || failFor(mbr, " that given is parameterized" )
31253123
31263124 def willBeImplementedInParentClass (m : TermRef ) =
31273125 val superCls = cls.superClass
You can’t perform that action at this time.
0 commit comments