Skip to content

Make more parts of stdlib compile #1826

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 20 commits into from
Dec 21, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 18, 2016

No description provided.

@odersky
Copy link
Contributor Author

odersky commented Dec 19, 2016

The continuous-integration failure is because the drone does not pull updated versions of the scala-scala stdlib.

@odersky
Copy link
Contributor Author

odersky commented Dec 19, 2016

@felixmulder There's a dottyDoc failure, which causes the junit test to fail:

[error] Test dotty.tools.dottydoc.TestWhitelistedCollections.arrayHasDocumentation failed: java.lang.AssertionError: assertion failed: invalid prefix PolyType(List(1), List(T), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), TypeRef(ThisType(TypeRef(NoPrefix,scala)),Any))), RefinedType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),PartialFunction), scala$PartialFunction$$A, TypeAlias(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,scala)),package)/withSig(Signature(List(),)),Throwable), -1)), scala$PartialFunction$$B, TypeAlias(PolyParam(T), 1))), took 8.569 sec
[error]     at scala.Predef$.assert(Predef.scala:165)
[error]     at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:1386)
[error]     at dotty.tools.dotc.core.Types$TypeRef.<init>(Types.scala:1759)

Also, we need to pull in the latest scala-scala so that local CI succeeds.

@smarter
Copy link
Member

smarter commented Dec 19, 2016

Could the CI run git pull on scala-scala first?

@felixmulder
Copy link
Contributor

felixmulder commented Dec 19, 2016 via email

@odersky
Copy link
Contributor Author

odersky commented Dec 19, 2016

Rebased to master. Also, blacklisted SystemProperties again which apparently caused the dottydoc failure.

@felixmulder
Copy link
Contributor

felixmulder commented Dec 19, 2016

The CI can now update scala-scala (needs latest drone.yml from master)

@felixmulder
Copy link
Contributor

Regarding the doc-tool failure - I'll have a look at it tomorrow morning and add the commit to this PR

@felixmulder
Copy link
Contributor

I tried enabling the SystemProperties and compiling it with dottydoc - doesn't seem to crash the compiler anymore. But there is a stack overflow when compiling std lib from dottydoc. Not sure if it is relevant to the PR currently. Let me know if there's anything else I can do to help out here.

@odersky
Copy link
Contributor Author

odersky commented Dec 20, 2016

@felixmulder On validate-junit it still says:

[error] Test dotty.tools.dottydoc.TestWhitelistedCollections.arrayHasDocumentation failed: java.lang.AssertionError: assertion failed: invalid prefix PolyType(List(1), List(T), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), TypeRef(ThisType(TypeRef(NoPrefix,scala)),Any))), RefinedType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),PartialFunction), scala$PartialFunction$$A, TypeAlias(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,scala)),package)/withSig(Signature(List(),)),Throwable), -1)), scala$PartialFunction$$B, TypeAlias(PolyParam(T), 1))), took 15.693 sec
[error] at scala.Predef$.assert(Predef.scala:165)

Same for continuous-integration/drone/pr. I don't see a stackoverfloa anywhere (?).

But it might well be unrelated to sys/SystemProperties.

@felixmulder
Copy link
Contributor

felixmulder commented Dec 20, 2016

Hmm, not sure - the CI (both of them) give different results then when I run it locally on my machine. On my machine I get three stack overflows. One when compiling the standard library (compileStdLib) and then twice again when running the dottydoc tests - which also compile the whitelist, so that seemed reasonable. On the CI it is instead as you say, some invalid prefix. This seems to be the offending line:

[error]     at dotty.tools.dottydoc.core.DocASTPhase.dotty$tools$dottydoc$core$DocASTPhase$$membersFromSymbol$1(DocASTPhase.scala:49)

Which is this line: https://github.com/lampepfl/dotty/blob/master/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala#L49

I'm going to try it again with a clean repo.

UPDATE: on a clean build I get the same error as the CIs

@odersky
Copy link
Contributor Author

odersky commented Dec 20, 2016

🎉 Thanks for the quick fixes @felixmulder !

@odersky
Copy link
Contributor Author

odersky commented Dec 20, 2016

Current status: We have some bootstrap related issues, and at least two unrelated transform problems (one in tailrec, the other probably in elimByName). And then there are some files that compile only if there's no deep subtype check, we have to figure whether this is normal or a bug.

But I think the current state is ready to go in. Who wants to give it a shot for reviewing?

Under language:Scala2, don't require an explicit `override' when
overriding default methods of Java traits. `scalac` does currently
the same thing.
When faced with a denotation that combines parameterless and nullary method
definitions (toString is a common example), ignore any redundant () applications.
We looked under the wrong signature before, which meant that
we sometimes would not detect that a super accessor existed
already and generate a duplicate. Observed when compiling
stdlib's collection/mutable/ObservableMap.scala.
If the expected type is Unit, any parameterless member should
be considered applicable when doing overloading resolution.
Avoids potentially expensive string assembly operations.
1. Overriding a Java-8 concrete method now produces a migration warning under -language:Scala2,
2. Overriding a normal with a lazy val is now a migration warning instead of an error.
 - Move non-specialized functions to whitelist
 - Replace `macro ???` with just `???` in scala-scala
 Several other consolidations
Argument comparison of hk types did not take into account that
the compared types could have themselves wildcard arguments.
SystemProperties leads to a dottydoc failure, so stays blacklisted
for now. It does pass the normal compile-stdlib test.
@smarter
Copy link
Member

smarter commented Dec 20, 2016

I'll review tomorrow

@smarter smarter self-assigned this Dec 20, 2016
Fixing two failures in stdlib having to do with widening. In both
cases, a widenIfUnstable was required. One was widening too much,
the other too little.
Need to be careful not to read a classfile before a compilation unit
defining the annotation is entered.
@odersky
Copy link
Contributor Author

odersky commented Dec 21, 2016

@smarter I did not want to do that because it's ugly and inefficient, and, in 99.99% of cases, not needed.

@odersky
Copy link
Contributor Author

odersky commented Dec 21, 2016

I could not find out what the problems with whitelisting Function1 and Function2 are. the junit test passes but partest fails with a cyclic reference error. Can somebody with more partest fu figure out where that comes from?

Anyway, if we would compile Function1/2 as part of a bootstrap it would be done sequentially, so I don't see much of an issue.

That means the only real oustanding issue are the three tailcall failures. It would be good to adress those.

@odersky
Copy link
Contributor Author

odersky commented Dec 21, 2016

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Dec 21, 2016

We get a project loading failed on continuous integration. @felixmulder any way to do the equivalent of /rebuild here?

@smarter
Copy link
Member

smarter commented Dec 21, 2016

Felix tells me that our CI is running out of disk space, so out of order for now

@smarter
Copy link
Member

smarter commented Dec 21, 2016

Fabien is on it.

@felixmulder
Copy link
Contributor

felixmulder commented Dec 21, 2016 via email

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

* 0th strategy: If `tree` overrides a nullary method, mark the prototype
* so that the argument is dropped and return `tree` itself.
*
* After that, two strategies are tried, and the firs that is successful is picked.
Copy link
Member

Choose a reason for hiding this comment

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

typo: firs -> first

@@ -75,7 +84,11 @@ class FrontEnd extends Phase {
}
unitContexts foreach (parse(_))
record("parsedTrees", ast.Trees.ntrees)
unitContexts.foreach(enterSyms(_))
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with foreach here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to keep track of remaining.

@smarter smarter merged commit 404ce76 into scala:master Dec 21, 2016
@allanrenucci allanrenucci deleted the fix-compile-stdlib branch December 14, 2017 19:19
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.

3 participants