Skip to content

Conversation

@noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Apr 8, 2021

Fix:

scalac -Yexplicit-nulls -language:unsafeNulls tests/explicit-nulls/unsafe-common/unsafe-select-type-member.scala
import java.util.ArrayList

def f[T]: ArrayList[T] = {
  val cz = Class.forName("java.util.ArrayList")
  val o = cz.newInstance() // error: T of Class[?] | Null
  o.asInstanceOf[ArrayList[T]]
}

@noti0na1 noti0na1 requested a review from odersky April 8, 2021 17:35
@odersky odersky merged commit b44cafa into scala:master Apr 11, 2021
@odersky odersky deleted the fix-type-member-select branch April 11, 2021 08:07
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants