Skip to content

Fix check bounds #1012

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

Closed
wants to merge 4 commits into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 30, 2015

I noticed that we do not check all bounds of type parameters. Fixing this revealed another
problem when compiling stdlib which this commit also fixes. However, bounds checking
in PostTyper now causes deep subtypes, so stdlib has to be compiled without -Yno-dee-subtypes.
Review by @smarter.

This is important for IDEs who want to see the full tree.
The tree now gets replaced by a TypeTree in PostTyper.
Previously, bounds of a TypeDef tree were not checked. We now make
sure bounds are checked everywhere in PostTyper. The previous
partial check in Applications gets removed (it was not complete
even for TypeApplications because sometimes bounds were not yet
known when the test was performed.)
Checking bounds everywhere revealed a problem in compileStdLib,
which this commit fixes.
New test that exhibited the problem is ski.scala. Previously
this did not fail with a bounds violation.
@smarter
Copy link
Member

smarter commented Dec 30, 2015

I haven't looked into it much yet, but I think the deep subtype error is worth investigating, it happens just by running:

./bin/dotc -Yno-deep-subtypes ./scala-scala/src/library/scala/collection/generic/ParMapFactory.scala

however, if I enable the subtyping Printer in Printers.scala and run:

./bin/dotc -Ylog:all -Yno-deep-subtypes ./scala-scala/src/library/scala/collection/generic/ParMapFactory.scala

Then the error disappears! So clearly it's possible to typecheck this without deep subtyping

@odersky
Copy link
Contributor Author

odersky commented Dec 30, 2015

An explanation could be that LazyRefs forcing creates additional subtypes.
Printing forces ahead of time, so there are fewer subtype tests.

On Wed, Dec 30, 2015 at 5:51 PM, Guillaume Martres <notifications@github.com

wrote:

I haven't looked into it much yet, but I think the deep subtype error is
worth investigating, it happens just by running:

./bin/dotc -Yno-deep-subtypes ./scala-scala/src/library/scala/collection/generic/ParMapFactory.scala

however, if I enable the subtyping Printer in Printers.scala and run:

./bin/dotc -Ylog:all -Yno-deep-subtypes ./scala-scala/src/library/scala/collection/generic/ParMapFactory.scala

Then the error disappears! So clearly it's possible to typecheck this
without deep subtyping


Reply to this email directly or view it on GitHub
#1012 (comment).

Martin Odersky
EPFL

@smarter
Copy link
Member

smarter commented Dec 30, 2015

I think I got it, see #1014.

@odersky
Copy link
Contributor Author

odersky commented Jan 3, 2016

Superseded by #1014

@odersky odersky closed this Jan 3, 2016
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.

2 participants