Skip to content

Fix of #50 - volatile #53

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 1 commit into from
Mar 12, 2014
Merged

Fix of #50 - volatile #53

merged 1 commit into from
Mar 12, 2014

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 9, 2014

Volatile checking needs to take all intersections into account; previously these
could be discarded through needsChecking.

Plus several refactorings and additions.

  1. Module vals now have Final and Stable flags set
  2. All logic around isVolatile is now in TypeOps; some of it was moved from Types.
  3. Added stability checking to Select and SelectFromType typings.

Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name
"isRealizable"?.

Volatile checking needs to take all intersections into account; previously these
could be discarded through needsChecking.

Plus several refactorings and additions.

1) Module vals now have Final and Stable flags set
2) All logic around isVolatile is now in TypeOps; some of it was moved from Types.
3) Added stability checking to Select and SelectFromType typings.

Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name
"isRealizable"?.
@odersky
Copy link
Contributor Author

odersky commented Mar 9, 2014

Review by @samuelgruetter @namin

*
* Lazy values are not allowed to have volatile type, as otherwise
* unsoundness can result.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

this (important) documentation is deleted, but not added anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. It should have been added to isVolatile in TypeOps, but that change got lost somehow.

@samuelgruetter
Copy link
Contributor

Todo: We should find a better name for isVolatile. Maybe define the negation instead under the name "isRealizable"?.

+1

@samuelgruetter
Copy link
Contributor

I just pulled in these changes and ran the example I gave in #50 and it's still accepted...

@samuelgruetter
Copy link
Contributor

I've started my own isRealizable function, see here.
It passes all tests, except one that I've added just now. The problem is that isRealizable(NoType) is called, and I don't know (yet) why...

@odersky
Copy link
Contributor Author

odersky commented Mar 10, 2014

The example is in #50 is still accepted because isVolatile is not supposed to flag this one. is Volatile is an overapproximation of: The type is feasible now but it might become unfeasible by refining some of its abstract components. Feasibility of types has to be tested elsewhere. The right thing to do is to design and write a phase (what sued to be refChecks) that does this.

@samuelgruetter
Copy link
Contributor

That makes sense. I've just found out myself why we need to put this into refChecks ;-) It's because my isRealizable function (which tries to check everything) depends on the types of not yet typed trees (that's why isRealizable(NoType) was called...).

@samuelgruetter
Copy link
Contributor

LGTM [modulo the lost documentation for isVolatile ;-)]

@namin
Copy link
Contributor

namin commented Mar 10, 2014

LGTM, though shouldn't we leave issue #50 open?
Also, is the documentation that was deleted up-to-date, anyways? Is an aliased type member considered abstract?

@odersky odersky merged commit af337f0 into scala:master Mar 12, 2014
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