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

Unexpected Symbols$CyclicReference exception #9177

Open
scabug opened this issue Feb 23, 2015 · 4 comments
Open

Unexpected Symbols$CyclicReference exception #9177

scabug opened this issue Feb 23, 2015 · 4 comments
Milestone

Comments

@scabug
Copy link

scabug commented Feb 23, 2015

For some classes type comparison (<:<) throws CyclicReference exception. I's hard for me to tell exactly why this happens, but I found one example where I able to reproduce it:

typeOf[java.util.Date] <:< typeOf[net.sf.ehcache.CacheManager]

I have a feeling that there is something is very special about net.sf.ehcache.CacheManager which causes this issue.

for convenience I created this small project that demonstrates the issue:

https://github.com/OlegIlyenko/scala-reflection-cyclic-reference-error

You can find an exception with full stack-trace in the build of the project:

https://travis-ci.org/OlegIlyenko/scala-reflection-cyclic-reference-error/builds/51876517#L342

The actual code to reproduce the issue is here:

https://github.com/OlegIlyenko/scala-reflection-cyclic-reference-error/blob/master/src/main/scala/ErrorTest.scala

@scabug
Copy link
Author

scabug commented Feb 23, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9177?orig=1
Reporter: Oleg Ilyenko (oleg.ilyenko)
Affected Versions: 2.11.5

@scabug
Copy link
Author

scabug commented Feb 24, 2015

@xeno-by said:
Looks like a spurious exception indeed. How critical is this issue for you?

@scabug
Copy link
Author

scabug commented Feb 24, 2015

Oleg Ilyenko (oleg.ilyenko) said:
Well, workaround is already in place:

https://github.com/scaldi/scaldi/blob/master/src/main/scala/scaldi/util/ReflectionHelper.scala#L68

I don't like it though, would be happy to get rid of it as soon as possible (Ideas for better workaround are very welcome).

The issue manifested itself during the tests of the new DI mechanism of Play 2.4-M2, play-cache plugin and scaldi, since it uses <:< in a few places.

@scabug
Copy link
Author

scabug commented Jun 3, 2016

Chen,Shuxun (Bear) said:
The issue could also be reproduced by using types generated by apache thrift. For example:

typeOf[structStringList] <:< typeOf[String]

the "structStringList" is a type generated by apache thrift through the definition:
struct structStringList {
1: required list ll
}

@scabug scabug added this to the Backlog milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants