Skip to content

Make tests pass #623

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

Merged
merged 10 commits into from
May 31, 2015
Merged

Make tests pass #623

merged 10 commits into from
May 31, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 29, 2015

Subsumes #621, adding fixes for the test failures. #580 is open again. @review by @DarkDimius @smarter

odersky added 4 commits May 29, 2015 15:45
Constants that are adapted to a different supertype need to do this
explicitly (not just by changing the type). Otherwise tree checkers
will compute the original type and fail.

This caused a test failure in pos/harmonize. The mystery is why this
was not caught in the checkin tests.
…nclosing class is also the top-level class"

This reverts commit 6898d2c.
odersky added 2 commits May 29, 2015 17:21
Previously was only done for DefDefs. Caused backend failure.
@odersky
Copy link
Contributor Author

odersky commented May 29, 2015

I believe the tests hang. Running locally shows that lots of tests fail, all because of the revert of 78aa682.
To summarize:

If 78aa682 is enabled junit tests fail because we cannot compile ClassPath.
If the commit is disabled lots of run tests fail with verify errors. For instance:

Users/odersky/workspace/dotty/tests/run> dotc arybufgrow.scala -d /classes
/Users/odersky/workspace/dotty/tests/run> java Test
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
Test$.$anonfun$$init$$1(I)Lscala/collection/mutable/ArrayBuffer; @0: aload_0
Reason:
Type integer (current frame, locals[0]) is not assignable to reference type
Current Frame:
bci: @0
flags: { }
locals: { integer }
stack: { }
Bytecode:
0x0000000: 2ab6 005e 126f b600 73b0

The other failures are similar.

I am at the end of what I can do. @DarkDimius you need to take this over. It's really important to get the build back to work quickly!

@DarkDimius
Copy link
Contributor

@odersky, taking this over.

@DarkDimius
Copy link
Contributor

this failure is indeed manifestation of reverted commit:

private static scala.collection.mutable.ArrayBuffer $anonfun$$init$$1(int);
    Code:
       0: aload_0
       1: invokevirtual #94                 // Method buf:()Lscala/collection/mutable/ArrayBuffer;

This is static method, that tries to access this.

@odersky
Copy link
Contributor Author

odersky commented May 29, 2015

Curiously, the test of #580 was not affected by reverting the fix. It still works, but lots of other run tests fail. So I am bringing it back. @DarkDimius over to you now.

@odersky
Copy link
Contributor Author

odersky commented May 29, 2015

@DarkDimius You might want to cherry-pick db11fc5
It did not help when I tested it, but maybe it just needs tweaking.

@smarter
Copy link
Member

smarter commented May 30, 2015

/rebuild

@smarter
Copy link
Member

smarter commented May 30, 2015

@DarkDimius : Can you get this to rebuild? It seems that Jenkins restarted and now it's stuck saying "validate-partest — [85] Building. " even though the job was aborted.

@smarter smarter force-pushed the make-tests-pass branch from beae6e8 to 8f90105 Compare May 30, 2015 17:53
@smarter
Copy link
Member

smarter commented May 30, 2015

Forced rebuild by changing the commit message.

@smarter
Copy link
Member

smarter commented May 30, 2015

Partest now finish running! It fails because of tests/run/t6260-delambdafy.scala for exactly the reason I explained in: smarter@4d23983#commitcomment-11339871 It tries to check an implementation detail that can change. I'm going to push another commit to disable checking the methods of the lambda.

@DarkDimius
Copy link
Contributor

@smarter, we should not disable checking of lamdas. Tests exist to ensure that the way how lambdas are generated does not change without our notice.
If the behavior changes, and the change is expected, the check file should be updated.

@smarter
Copy link
Member

smarter commented May 30, 2015

OK, I just updated the check file, but this might be annoying if we change the details of lambda generation often.

- Only transform static methods which are inside module classes.
- Make sure that the prefix of the underlying type of the Ident
  is a ThisType of the current module class. For example in
  "scala.Int.box(42)", "box" is an Ident whose underlying type is
  "TermRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Int$)),box)",
  but we should not trigger an assertion in this case.
@smarter
Copy link
Member

smarter commented May 30, 2015

After fixing ElimStaticThis, all tests now pass! ✨ ✨
@DarkDimius: For some reason github says that validate-partest is still Building., but if you click on https://scala-ci.typesafe.com/job/dotty-master-validate-partest/88/ you'll see that the build finished successfully.

@smarter
Copy link
Member

smarter commented May 31, 2015

/synch

// so instead we require this phase to run after Flatten and use meth.owner
if (meth.is(JavaStatic) && meth.owner.is(ModuleClass)) {
tree.tpe match {
case TermRef(thiz: ThisType, _) if (thiz.underlying.typeSymbol == meth.owner) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of .underlying.termSymbol it's simpler to use just .cls.

@odersky
Copy link
Contributor Author

odersky commented May 31, 2015

LGTM. Glad to have this working in master.

odersky added a commit that referenced this pull request May 31, 2015
@odersky odersky merged commit 5d99a49 into scala:master May 31, 2015
@DarkDimius
Copy link
Contributor

@odersky, some of the changes that have been merged in this PR should be reverted.
3d240ad actually broke the transformation of inner objects, and it needs to be reverted if we want to move labdas to static methods in companion class.

@smarter smarter mentioned this pull request Jun 1, 2015
@allanrenucci allanrenucci deleted the make-tests-pass branch December 14, 2017 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants