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

Comments

@scabug
Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented May 2, 2012

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

@scabug

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented May 3, 2012

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

@scabug scabug closed this Jun 5, 2012

@scabug

This comment has been minimized.

Copy link
Author

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
2 participants
You can’t perform that action at this time.