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

Inexplicitly outer in 2ry ctor #7274

Closed
scabug opened this issue Mar 20, 2013 · 6 comments
Closed

Inexplicitly outer in 2ry ctor #7274

scabug opened this issue Mar 20, 2013 · 6 comments

Comments

@scabug
Copy link

scabug commented Mar 20, 2013

Description Resource Path Location Type
Error in Scala compiler: while compiling: /home/jmv/src/scala_learn/src/CopyofInferenceSwingWorker.scala during phase: global=explicitouter, atPhase=erasure library version: version 2.10.1 compiler version: version 2.10.1 reconstructed args: -Xpluginsdir /home/jmv/apps/eclipse4/configuration/org.eclipse.osgi/bundles/737/1/.cp/lib -deprecation -classpath /home/jmv/apps/jdk1.7.0_17/jre/lib/resources.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/rt.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jsse.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jce.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/charsets.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jfr.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/sunjce_provider.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/zipfs.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/sunec.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/localedata.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/sunpkcs11.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/ext/dnsns.jar:/home/jmv/src/scala_learn/bin:/home/jmv/apps/eclipse4/configuration/org.eclipse.osgi/bundles/738/1/.cp/lib/scala-swing.jar:/home/jmv/apps/eclipse4/configuration/org.eclipse.osgi/bundles/738/1/.cp/lib/scala-actors.jar:/home/jmv/apps/eclipse4/configuration/org.eclipse.osgi/bundles/737/1/.cp/lib/scala-reflect.jar -explaintypes -g:notailcalls -bootclasspath /home/jmv/apps/jdk1.7.0_17/jre/lib/resources.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/rt.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/sunrsasign.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jsse.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jce.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/charsets.jar:/home/jmv/apps/jdk1.7.0_17/jre/lib/jfr.jar:/home/jmv/apps/jdk1.7.0_17/jre/classes:/home/jmv/apps/eclipse4/configuration/org.eclipse.osgi/bundles/738/1/.cp/lib/scala-library.jar -unchecked last tree to typer: Literal(Constant(())) symbol: null symbol definition: null tpe: Unit symbol owners: context owners: value evt -> method propertyChange -> anonymous class $anon -> constructor InferenceSwingWorker2 -> class InferenceSwingWorker2 -> package inference == Enclosing template or block == DefDef( // def propertyChange(evt: java.beans.PropertyChangeEvent): Unit "propertyChange" [] // 1 parameter list ValDef( // evt: java.beans.PropertyChangeEvent "evt" // tree.tpe=java.beans.PropertyChangeEvent ) // tree.tpe=Unit Apply( // def setProgress(progress: Int): Unit in class InferenceProgressFrame, tree.tpe=Unit InferenceSwingWorker2.this.eulergui$gui$inference$InferenceSwingWorker2$$frame()."setProgress" // def setProgress(progress: Int): Unit in class InferenceProgressFrame, tree.tpe=(progress: Int)Unit 11 ) ) == Expanded type of tree == TypeRef(TypeSymbol(final abstract class Unit extends AnyVal)) no-symbol does not have an owner scala_learn Unknown Scala Problem

@scabug
Copy link
Author

scabug commented Mar 20, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7274?orig=1
Reporter: Jean-Marc Vanel (jmvanel)
Affected Versions: 2.10.1, 2.12.1
Attachments:

@scabug
Copy link
Author

scabug commented Jan 31, 2017

@som-snytt said:
The Outer Limits.

class C {
  var i = 0
  def this(j: Int) = {
    this()
    new AnyRef() {
      i = j
    }
  }
}

@SethTisue
Copy link
Member

Som's example still crashes in 2.13.0-M3

@som-snytt
Copy link

There were a couple of fixes in constructors and this works now. Thanks to Lukas.

Wait, what about Dotty? Is it fixed in Dotty? Yes, it is.

@SethTisue SethTisue modified the milestones: Backlog, 2.13.8 Apr 4, 2022
@SethTisue
Copy link
Member

(Milestoned 2.13.8, but perhaps the actual fix came in some earlier 2.13.x version.)

@som-snytt
Copy link

The fix fix was 2.13.4 scala/scala#9226 The previous fix and regression was 2.13.0 and 2.13.3. This is the one they called "embarrassingly simple to reproduce" and "actually two bugs, one was fixed and the other was backported." The fix fix was backported in 2.12.13.

@som-snytt som-snytt modified the milestones: 2.13.8, 2.13.4 Apr 4, 2022
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

4 participants