Related to #26802 (pointed out by @SolalPirelli )
Currently, Scala 3 accepts @throws annotations on any places. However @throws is effective only on methods/constructors, and otherwise it's ignored.
Scala 2 already rejects @throws on non-methods/constructors:
import java.io.IOException
@throws(classOf[IOException])
class C
// error: @throws only allowed for methods and constructors
Proposal
Reject @throws earlier aligned with Scala 2.
Scala 2: scala/scala#9465
Related to #26802 (pointed out by @SolalPirelli )
Currently, Scala 3 accepts
@throwsannotations on any places. However@throwsis effective only on methods/constructors, and otherwise it's ignored.Scala 2 already rejects
@throwson non-methods/constructors:Proposal
Reject
@throwsearlier aligned with Scala 2.Scala 2: scala/scala#9465