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

"Unable to locate class file for inner class" #11062

Closed
elfprince13 opened this issue Aug 8, 2018 · 7 comments
Closed

"Unable to locate class file for inner class" #11062

elfprince13 opened this issue Aug 8, 2018 · 7 comments

Comments

@elfprince13
Copy link

I have two source files, one Java, one Scala.
The Java class definition is as follows:

public class HeapNode<Elem> extends Node<HeapNode<Elem>> implements Cloneable {
	volatile LazyBraunHeapLF.NodeEvalState<Elem> state;
	
	HeapNode(LazyBraunHeapLF.NodeEvalState<Elem> initState){
		state = initState;
	}
	
	@SuppressWarnings("rawtypes")
	public static final AtomicReferenceFieldUpdater<HeapNode, LazyBraunHeapLF.NodeEvalState> updateState 
					= AtomicReferenceFieldUpdater.newUpdater(HeapNode.class, LazyBraunHeapLF.NodeEvalState.class, "state");

	
}

The Scala source contains the following:

object LazyBraunHeapLF {
	
	class EmptyNode[E] extends HeapNode[E](Empty[E]()){
		marked = true
	}
	
	sealed trait Immediate[E]{ this: NodeEvalState[E] =>
		def force:NodeEvalState[E] with Immediate[E] = this
	}
	
	sealed abstract class NodeEvalState[E] {
		def force: NodeEvalState[E] with Immediate[E]
	}
	
	case class Empty[E]() extends NodeEvalState[E] with Immediate[E]
	// The remainder is commented out for a M(N)WE
}

Everything works fine with a clean build, or if the definition of class EmptyNode[E] is commented out; however, after roughly ~1 edit cycle, I get the following error message:

[error] Unable to locate class corresponding to inner class entry for NodeEvalState in owner LazyBraunHeapLF
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 2 s, completed Aug 8, 2018 11:30:33 AM

I'm using Scala 2.12.6 on Java 8. Notably, the class file in question exists on my file system.

@ghik
Copy link

ghik commented Jun 10, 2020

I've been fighting with this issue for a long time. It almost makes the incremental compiler unusable in some situations, forcing me to rebuild the project over and over again.

@SethTisue
Copy link
Member

do we have reason to believe this is a scalac bug and not a zinc bug?

@elfprince13
Copy link
Author

I have no recollection of how I triggered this bug, and ended up switching that whole project over to dotty anyway.

@SethTisue
Copy link
Member

SethTisue commented Jun 16, 2020

@ghik do you think you might be able to isolate and reproduce this?

@ghik
Copy link

ghik commented Jun 16, 2020

@SethTisue since it is related to incremental compilation, it happens seemingly randomly and I'm afraid it won't be easy to reproduce.

@SethTisue
Copy link
Member

SethTisue commented Jun 16, 2020

okay, I'm going to close this because it's almost certainly a zinc bug. unfortunately GitHub doesn't let me transfer issues from org to org, only within the same org.

@dwijnand
Copy link
Member

Hand-transferred as sbt/zinc#797.

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

No branches or pull requests

4 participants