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

Type checker looks for accessor in package #1094

Closed
scabug opened this issue Jul 7, 2008 · 9 comments
Closed

Type checker looks for accessor in package #1094

scabug opened this issue Jul 7, 2008 · 9 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 7, 2008

Compile the following code.

package a {
  protected object A { def f = null }
}

package a.b {
  class X { a.A.f }
}

The compiler crashes with the following stack trace.

java.lang.AssertionError: no acc def buf for package a
	at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.accDefBuf(SuperAccessors.scala:45)
	at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.makeAccessor(SuperAccessors.scala:300)
	at scala.tools.nsc.typechecker.SuperAccessors$$SuperAccTransformer.transform(SuperAccessors.scala:206)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1361) 
	...
@scabug
Copy link
Author

scabug commented Jul 7, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1094?orig=1
Reporter: @gaydenko

@scabug
Copy link
Author

scabug commented Jul 7, 2008

@gaydenko said:
Well, have found concrete place when adding 'protected' causes the error - it isn't for class or trait, it is for object :-)

@scabug
Copy link
Author

scabug commented Jul 8, 2008

@dubochet said:
I suppose you can't describe a reproducible scenario that leads to this crash? If not, I'll forward the issue to the maintainer anyway, but the likelihood of him fixing the bug would be dramatically reduced.

@scabug
Copy link
Author

scabug commented Jul 8, 2008

@gaydenko said:
Still can not. I'll try this night again and will report on success.

@scabug
Copy link
Author

scabug commented Jul 8, 2008

@gaydenko said:
Have found. Say:

  • srcRoot/po/Obj.scala with this (incorrect because of 'protected') code:
package po

protected object Obj { def f = {} }
  • srcRoot/po/sub/ObjCall.scala with a code:
package po.sub

import po.Obj

class ObjCall { Obj.f }

All these give: "An internal error occurred during: "Building Workspace". no acc def buf for package po".

Helpful?

@scabug
Copy link
Author

scabug commented Jul 9, 2008

@dubochet said:
Thank you, that report is definitely in a usable form now. I confirmed it in r15501.

I've rewritten the test case as a single file and updated the bug description.

@scabug
Copy link
Author

scabug commented Aug 1, 2008

@odersky said:
Iulian can you have a look at this? This seems to be about protected accessors...

@scabug
Copy link
Author

scabug commented Feb 4, 2009

scala-at-kalucki.com (jkalucki) said:
I have also walked into this bug. A nearly identical situation and output, in 2.7.3-final.

In my case, the base package had package scoped protected (e.g. protected[packagename]) declarations that tickled this issue.

@scabug
Copy link
Author

scabug commented Mar 30, 2009

@dragos said:
Fixed in r17402. I only tested the use case described in the initial ticket. jkalucki, if this does not fix your issue, please open another ticket with an example of the failing program.

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

2 participants