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

namer to typer handoff of synthetic implicit class factory method breaks under presentation compiler if interrupted #8941

Closed
scabug opened this issue Oct 28, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 28, 2014

git diff head -- test
diff --git a/test/files/presentation/implicit-class-error.check b/test/files/presentation/implicit-class-error.check
new file mode 100644
index 0000000..3418049
--- /dev/null
+++ b/test/files/presentation/implicit-class-error.check
@@ -0,0 +1,7 @@
+reload: Source.scala
+
+askType at Source.scala(6,7)
+================================================================================
+[response] askTypeAt (6,7)
+scala.this.Predef.???
+================================================================================
diff --git a/test/files/presentation/implicit-class-error/Runner.scala b/test/files/presentation/implicit-class-error/Runner.scala
new file mode 100644
index 0000000..0a8923a
--- /dev/null
+++ b/test/files/presentation/implicit-class-error/Runner.scala
@@ -0,0 +1,11 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+
+object Test extends InteractiveTest {
+  override def runDefaultTests() {
+    // make sure typer is done.. the virtual pattern matcher might translate
+    // some trees and mess up positions. But we'll catch it red handed!
+    // sourceFiles foreach (src => askLoadedTyped(src).get)
+    super.runDefaultTests()
+  }
+
+}
diff --git a/test/files/presentation/implicit-class-error/src/Source.scala b/test/files/presentation/implicit-class-error/src/Source.scala
new file mode 100644
index 0000000..7438ccc
--- /dev/null
+++ b/test/files/presentation/implicit-class-error/src/Source.scala
@@ -0,0 +1,8 @@
+object Foo {
+  implicit class MatCreator(val ctx: StringContext) extends AnyVal {
+    def m(args: Any*): Unit = {
+      ctx.checkLengths(args)
+    }
+    ???/*?*/
+  }
+}

That test currently fails with an assertion. I have a patch pending

@scabug
Copy link
Author

scabug commented Oct 28, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8941?orig=1
Reporter: @retronym
Affected Versions: 2.11.4

@scabug
Copy link
Author

scabug commented Oct 28, 2014

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