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

scala.tools.nsc.symtab.Types$$TypeError: wrong number of arguments for method takeAnd #1110

Closed
scabug opened this issue Jul 15, 2008 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 15, 2008

Attempting to compile the attached file generates the error message

scala.tools.nsc.symtab.Types$$TypeError: wrong number of arguments for method takeAnd: (java.lang.Object,java.lang.Object)java.lang.Object
	at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:350)
	at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:256)
	at scala.tools.nsc.typechecker.Infer$$Inferencer.errorTree(Infer.scala:260)
	at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:1686)
	at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:2538)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3125)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3276)
	at scala.tools.nsc.typechecker.Typers$$Typer.typedIf$$1(Typers.scala:2330)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3028)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
	at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.callAsOperator$$1(CleanUp.scala:396)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:482)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1357)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1347)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1349)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$5.apply(Trees.scala:1294)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$5.apply(Trees.scala:1293)
	at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1409)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1292)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1385)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformTrees$$1.apply(Trees.scala:1385)
	at scala.List$$.loop$$1(List.scala:293)
	at scala.List$$.mapConserve(List.scala:310)
	at scala.tools.nsc.ast.Trees$$Transformer.transformTrees(Trees.scala:1385)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:522)
	at scala.tools.nsc.ast.Trees$$Transformer.transformTemplate(Trees.scala:1387)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1281)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$2.apply(Trees.scala:1281)
	at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1409)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1280)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1403)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transformStats$$1.apply(Trees.scala:1401)
	at scala.List$$.loop$$1(List.scala:293)
	at scala.List$$.mapConserve(List.scala:310)
	at scala.tools.nsc.ast.Trees$$Transformer.transformStats(Trees.scala:1401)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1277)
	at scala.tools.nsc.ast.Trees$$Transformer$$$$anonfun$$transform$$1.apply(Trees.scala:1277)
	at scala.tools.nsc.ast.Trees$$Transformer.atOwner(Trees.scala:1409)
	at scala.tools.nsc.ast.Trees$$Transformer.transform(Trees.scala:1276)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transform(CleanUp.scala:564)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transformUnit(CleanUp.scala:173)
	at scala.tools.nsc.transform.CleanUp$$CleanUpTransformer.transformUnit(CleanUp.scala:25)
	at scala.tools.nsc.transform.Transform$$Phase.apply(Transform.scala:30)
	at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:257)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
	at scala.Iterator$$class.foreach(Iterator.scala:395)
	at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
	at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243)
	at scala.tools.nsc.Global$$Run.compileSources(Global.scala:555)
	at scala.tools.nsc.Global$$Run.compile(Global.scala:640)
	at scala.tools.nsc.StandardCompileServer.session(CompileServer.scala:137)
	at scala.tools.util.SocketServer$$$$anonfun$$run$$1.apply(SocketServer.scala:69)
	at scala.tools.util.SocketServer$$$$anonfun$$run$$1.apply(SocketServer.scala:69)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:73)
	at scala.Console$$.withOut(Console.scala:84)
	at scala.Console$$.withOut(Console.scala:102)
	at scala.tools.util.SocketServer.run(SocketServer.scala:68)
	at scala.tools.nsc.StandardCompileServer.main(CompileServer.scala:179)
	at scala.tools.nsc.CompileServer.main(CompileServer.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at scala.tools.nsc.ObjectRunner$$$$anonfun$$run$$1.apply(ObjectRunner.scala:75)
	at scala.tools.nsc.ObjectRunner$$.withContextClassLoader(ObjectRunner.scala:49)
	at scala.tools.nsc.ObjectRunner$$.run(ObjectRunner.scala:74)
	at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:161)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
error: fatal error (server aborted): wrong number of arguments for method takeAnd: (java.lang.Object,java.lang.Object)java.lang.Object

@scabug
Copy link
Author

scabug commented Jul 15, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1110?orig=1
Reporter: @DRMacIver
Attachments:

  • andboom.scala (created on Jul 15, 2008 5:26:38 PM UTC, 112 bytes)

@scabug
Copy link
Author

scabug commented Aug 3, 2008

@phaller said:
The problem is due to a bug in the clean-up phase that generates dynamic calls to methods of structural types. Normally, this bug should be fixed by Gilles. Since he is currently in the hospital, I tried to find out what the problem is. It seems that the check done in callAsOperator is wrong. Basically, it checks whether getPrimitiveReplacementForStructuralCall isDefinedAt ad.symbol.name returns true which it does since there is a replacement defined for the & operator. The problem is that the check does not take into account that & might be a method of a structural type.

@scabug
Copy link
Author

scabug commented Jul 15, 2009

@paulp said:
Fixed (possibly improvably) in r18301.

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