Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.isInstanceOf[GenericType[AnotherGenericType[...]]] should give an unchecked warning #6125

Closed
scabug opened this issue Jul 23, 2012 · 3 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Jul 23, 2012

The compiler/REPL normally give an unchecked warning with .isInstanceOf[GenericType[SomeType]], which makes sense since it gets type-erased to GenericType[Object].

However, .isInstanceOf[GenericType[AnotherGenericType[...]]] does not give any warning, even though it is equally affected by type erasure.

I asked about this on Stack Overflow (some more examples there): http://stackoverflow.com/questions/11554323/why-does-some123-isinstanceofoptionliststring-not-give-an-unchecked

The answer http://stackoverflow.com/a/11555642/319931 shows where in the compiler code the issue is; in particular "[t]he check function returns unit without performing any test" for generic types.

@scabug
Copy link
Author

scabug commented Jul 23, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6125?orig=1
Reporter: Mechanical snail (mechanicalsnail)
Affected Versions: 2.9.1

@scabug
Copy link
Author

scabug commented Jul 23, 2012

@paulp said:
scala/scala#973

@scabug
Copy link
Author

scabug commented Jul 23, 2012

@paulp said:
186f57ab4b

@scabug scabug closed this as completed Jul 23, 2012
@scabug scabug added the typer label Apr 7, 2017
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants