Skip to content

Fix/systematic prototypes #136

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 14 commits into from
Jun 20, 2014

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 30, 2014

More fixes for tests, and a re-org of prototype handling. Review by @DarkDimius, @samuelgruetter

odersky added 14 commits May 30, 2014 14:34
"_" type paraeters need to be given fresh names.
1) glb/lub's are reported to subtyping printer instead of typr
2) Null arguments of function protos are printed with their types
   (views sometimes are transformed into these).
This fixes a bug introuced by 7754c1e.

The reporter state need to be reset undconditionally in a tryWithFallback.
Another problem where we need to insert an implicit on the result type of complex operation.

Two additions: (1) If adapt fails, we now try with a weaker FunProto without result type, thus
allowing for an additional implicit cpmversion on the result. (2) An Application in a committable
context will not fail if the result type does not match the expected one. The problem will be
simply deferred in that case.
Needed to wrap a dummyTreeOfType in a TypedSplice to prevent re-typechecking. (In fact, the
"tree without pos" check revealed a deeper problem: DummyTrees of types could be typed again,
but without the surrounding TypedSplice, the originally stored type would be forgotten and Null
would be returned.
Auxiliary constructors need to be wrapped in the type parameters of the primary constructor.
Otherwise they will not take part in type inference.
The first part of a type ascription e: T can be a pattern or an expression. The mode
has to be kept depending on what it was on the outside.
The type of a SelectionProto needs to be ignorable because there might be an
implicit conversion on the selection. E.g.

    implicit def a2b(x: A): B = ???
    val x: { a: A } = ???
    val b: B = x.a

This was previously handled by allowing implicit conversions in compatibility checks.
But it turns out we can afford to ignore the type of a selectProto and unignore on ambiguities
later.
Following the example of SelectionProto, we now always hide the result in a FunProto
behind an IgnoreProto. This avoids a special case retry with a weaker FunProto in
tryInsertApplyOrImplicit.
In a refinement type T { R } we do not need T to be a class. But analyzing the refeinement
type will create a temporary class type. This refinement class has to be treated specially in
what concerns parent types.
@odersky
Copy link
Contributor Author

odersky commented Jun 20, 2014

I am going to merge this now because it's been sitting around for 21 days and the much larger pull request on higher-kinded types depends on it.

odersky added a commit that referenced this pull request Jun 20, 2014
@odersky odersky merged commit a8cb929 into scala:master Jun 20, 2014
@allanrenucci allanrenucci deleted the fix/systematic-prototypes branch December 14, 2017 19:23
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "[ISSUE-scala#19208] If scaladocs on file protocol don't do SPA routing." to 3.3 LTS
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