Skip to content

Pair is not an alias of Tuple2 #18

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

Closed
scabug opened this issue Aug 29, 2007 · 4 comments
Closed

Pair is not an alias of Tuple2 #18

scabug opened this issue Aug 29, 2007 · 4 comments

Comments

@scabug
Copy link

scabug commented Aug 29, 2007

If I load this code in Eclipse (plugin 2.6.3):

package test;

object PairTest {
  val foo = Tuple2(1, "Foo") :: Tuple2 (2, "Bar") :: Nil

  def main(args : Array[String]) : Unit = {
        System.out println (for (Pair(i, s) <- foo) yield { i + " " +  s })
  }
}

I get

BAIL: OffsetPosition(PairTest.scala,172) scala.this.Predef.Pair.unapply[Int, java.lang.String](<unapply-selector>) <unapply> ((i @ _), (s @ _)) class scala.tools.nsc.ast.Trees$$UnApply
BAIL: OffsetPosition(PairTest.scala,172) scala.this.Predef.Pair.unapply[Int, java.lang.String](<unapply-selector>) <unapply> ((i @ _), (s @ _)) class scala.tools.nsc.ast.Trees$$UnApply

If I change Pair to Tuple2 or leave it out, I get

Signature of L/PairTest/src/test/PairTest.scala changed, recompile dependent files
+[anonfun::Modifiers(1073741826,,List())[]]
-[anonfun::Modifiers(1073741826,,List())[]$$anonfun::Modifiers(1073741826,,List())[]]

and everything works.

(I have seen

**** COMPILER CRASH, RESET RESIDENT AND RETRY
**** COMPILER CRASH, GIVE UP, MAYBE DO CLEAN BUILD

on a clean build of more complex code containing

  for (Pair(id, Pair(foo, bar)) <- ...) yield {...}

so I think it is a compiler and not a plugin issue)

The code worked with a 2.5.something plugin.

@scabug
Copy link
Author

scabug commented Aug 29, 2007

Imported From: https://issues.scala-lang.org/browse/SI-18?orig=1
Reporter: Commit Message Bot (anonymous)
Assignee: @mcdirmid

@scabug
Copy link
Author

scabug commented Sep 5, 2007

@michelou said:
Updated milestone to "postponed"

@scabug
Copy link
Author

scabug commented Nov 24, 2007

@mcdirmid said:
Not fixing in the old plugin. Should actually be handled by our new aliasing support.

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone postponed deleted

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

1 participant