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

Message "error: type _$1 is defined twice" when compiled the second time #5240

Closed
scabug opened this issue Nov 28, 2011 · 7 comments
Closed

Comments

@scabug
Copy link

scabug commented Nov 28, 2011

I have a project in java (JaCoP http://sourceforge.net/projects/jacop-solver/) that I add scala wrapper for creating DSL. The scala code contains a number of classes and a package object. Compilation of this scala code works correct the first time but the second time, when doing changes in the code, it reports the following two errors:

error: type _$1 is defined twice
error: type _$1 is defined twice

It does not give any suggestion on possible error :( Cleaning the project and generating once more the code works correct again.

I can send the whole code on request but it is rather big. I send for you scala files that work with current version of JaCoP. Everything is on sourceforge.

/Kris

@scabug
Copy link
Author

scabug commented Nov 28, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5240?orig=1
Reporter: krzku
Affected Versions: 2.9.0, 2.9.1
Attachments:

@scabug
Copy link
Author

scabug commented Jan 15, 2012

@paulp said:
We don't have the resources to do this much of the work. Please reopen if you obtain a small self-contained reproduction.

@scabug
Copy link
Author

scabug commented Mar 28, 2012

krzku said:
Hi!

I have find a way around the bug but it might also be useful for finding it.

The statement that causes the bug is as follows (it is present in package object).

var labels: Array[_ <: org.jacop.core.Var] = null

The error is also reported when I use a full version of the existential type (wildcard above).

Defining the type separately as written below does not give an error (this is my way around9.

type DFS = DepthFirstSearch[_ <: org.jacop.core.Var]
var labels: Array[DFS] = null

The bug happens only if the first statement is defined in package object and after the first compilation (when class files already exist). It is not reported for the first compilation when there is no class files yet.

Hope it can help.

/Kris

@scabug
Copy link
Author

scabug commented May 2, 2012

@axel22 said:
Added pending test in pending/pos.

@scabug
Copy link
Author

scabug commented May 3, 2012

@dcsobral said:
This compiles for me, with Scala compiler version 2.10.0-20120430-094203-cfd037271e -- Copyright 2002-2011, LAMP/EPFL.

@scabug
Copy link
Author

scabug commented May 3, 2012

@paulp said:
The bug is still there, I reproduced it yesterday.

@scabug scabug closed this as completed Jun 5, 2012
@scabug
Copy link
Author

scabug commented Jun 5, 2012

@paulp said:
Duplicate of #5504.

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

2 participants