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

Macro programming: knownDirectSubclasses not populated #7588

Closed
scabug opened this issue Jun 18, 2013 · 4 comments
Closed

Macro programming: knownDirectSubclasses not populated #7588

scabug opened this issue Jun 18, 2013 · 4 comments

Comments

@scabug
Copy link

@scabug scabug commented Jun 18, 2013

Under certain circumstances, queriying knownDirectSubclasses from a sealed trait from within a macro yields an empty list. It seems to be related to compilation order. Perhaps related to #7567, #7046.

Minimised test case, to reproduce:

  • git clone -b knownDirectSubclasses git@github.com:Sciss/play-json-sealed.git
  • cd play-json-sealed
  • sbt clean compile

Observed behaviour: Compilation fails with

[info] Compiling 3 Scala sources to /Users/hhrutz/Documents/devel/play-json-sealed/test/target/scala-2.10/classes...
[error] exception during macro expansion: 
[error] java.lang.IllegalArgumentException: requirement failed: Did not find sub classes for type trait SelectionSize
[error] 	at scala.Predef$.require(Predef.scala:233)
[error] 	at foo.Checker$.applyImpl(Checker.scala:13)
[error] exception during macro expansion: 
[error] java.lang.IllegalArgumentException: requirement failed: Did not find sub classes for type trait Selection
[error] 	at scala.Predef$.require(Predef.scala:233)
[error] 	at foo.Checker$.applyImpl(Checker.scala:13)
[error] two errors found
[error] (test/compile:compile) Compilation failed

Expected behaviour: Should find the respective sub classes.

@scabug
Copy link
Author

@scabug scabug commented Jun 18, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7588?orig=1
Reporter: @Sciss
Affected Versions: 2.10.2
Duplicates #7046

@scabug
Copy link
Author

@scabug scabug commented Jun 19, 2013

@retronym said:
Already covered by #7046

@scabug
Copy link
Author

@scabug scabug commented Jun 19, 2013

@scabug
Copy link
Author

@scabug scabug commented Jun 19, 2013

@xeno-by said:
Ah I see now– 7046 is now about something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants