| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One last flurry with the broom before I leave you slobs to code
in your own filth. Eliminated all the trailing whitespace I
could manage, with special prejudice reserved for the test cases
which depended on the preservation of trailing whitespace.
Was reminded I cannot figure out how to eliminate the trailing
space on the "scala> " prompt in repl transcripts. At least
reduced the number of such empty prompts by trimming transcript
code on the way in.
Routed ConsoleReporter's "printMessage" through a trailing
whitespace stripping method which might help futureproof
against the future of whitespace diseases. Deleted the up-to-40
lines of trailing whitespace found in various library files.
It seems like only yesterday we performed whitespace surgery
on the whole repo. Clearly it doesn't stick very well. I suggest
it would work better to enforce a few requirements on the way in.
|
|
|
|
|
| |
wrapClassTagUnapply was generating an unpositioned tree
which would crash under -Yrangepos. See SI-6338.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In an effort to reduce the enormous amount of duplication
which now exists among methods which attempt to deduce something
about the relationship between two types, a sampling (and only
a sampling - this might not even be half of them) given here:
def isAsSpecific(ftpe1: Type, ftpe2: Type): Boolean
def isCompatibleByName(tp: Type, pt: Type): Boolean
def isConservativelyCompatible(tp: Type, pt: Type): Boolean
def isConsistent(tp1: Type, tp2: Type): Boolean
def isDifferentType(tp1: Type, tp2: Type): Boolean
def isDifferentTypeConstructor(tp1: Type, tp2: Type): Boolean
def isDistinguishableFrom(t1: Type, t2: Type): Boolean
def isNeverSubType(tp1: Type, tp2: Type): Boolean
def isNumericSubType(tp1: Type, tp2: Type): Boolean
def isPlausiblyCompatible(tp: Type, pt: Type): Boolean
def isPopulated(tp1: Type, tp2: Type): Boolean
def isSameType(tp1: Type, tp2: Type): Boolean
def isSameType2(tp1: Type, tp2: Type): Boolean
def isSubType(tp1: Type, tp2: Type): Boolean
def isWeakSubType(tp1: Type, tp2: Type): Boolean
def isWeaklyCompatible(tp: Type, pt: Type): Boolean
def matches(tpe1: Type, tpe2: Type): Boolean
def overlaps(tp1: Type, tp2: Type): Boolean
def typesConform(tp: Type, pt: Type): Boolean
I began pulling a thread left by moors in isPopulated:
need to investgate why this can't be made symmetric --
neg/gadts1 fails, and run/existials also.
Followed that to this code in TypeVar:
val newInst = wildcardToTypeVarMap(tp)
(constr isWithinBounds newInst) && { setInst(tp); true }
-------^
That was the obstacle to symmetry, because it creates a
cycle in e.g. run/existentials. Kept pulling the string,
came back to my own comment of long ago:
!!! Is it somehow guaranteed that this will not break
under nesting? In general one has to save and restore
the contents of the field...
Decided that uncertainty could no longer be tolerated.
Unless it can be proven somehow that there will never be
crosstalk among the save/suspension points, we should do
it this way even if nothing demands it yet.
What's in this commit:
- Made isPopulated symmetric.
- Made setInst resistant to TypeVar cycles.
- Fixed above mentioned bug in registerTypeEquality.
- Added some rigor to the suspension/unsuspension of TypeVars
so it will not break under nesting.
- Recovered pos/t0851.scala from its deletion.
|
|
|
|
|
| |
extrapolate GADT skolems: only complicate types when needed
make sure we only deskolemize GADT skolems after typedCase
|
|
|
|
|
|
|
|
| |
given moment (instead of throwing type errors). This avoids previous problems where we were creating fake error trees in some incorrect places like in type completers in Namers etc. Implicits relied heavily on type errors being thrown but performance should stay the same due to some explicit checks/returns.
Some of the problems involved how ambiguous error messages were collected/reported because it was very random (similarly for divergent implicits). This should be more explicit now. Reduced the number of unnecessary cyclic references being thrown (apart from those in Symbols/Types which don't have a context and need to stay for now as is).
Review by @paulp, @odersky.
|
| |
|
|
|
|
|
|
|
| |
Added *.log and build/ to gitignore so partest/ant artifacts don't show
up in our commit messages. Also fixed whitespace issues arising from the
filter-branch history rewrite for git move.
|
|
|
|
|
|
|
| |
Fixed type unsoundness problem in t5120 and also discovered by
roman.kalukiewicz@gmail.com. Fix should be refined further, as I am not
convinced we are quite done yet. Review by moors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Important note for busy commit log skimmers ***
Symbol method "fullName" has been trying to serve the dual role of "how
to print a symbol" and "how to find a class file." It cannot serve both
these roles simultaneously, primarily because of package objects but
other little things as well. Since in the majority of situations we want
the one which corresponds to the idealized scala world, not the grubby
bytecode, I went with that for fullName. When you require the path to a
class (e.g. you are calling Class.forName) you should use javaClassName.
package foo { package object bar { class Bippy } }
If sym is Bippy's symbol, then
sym.fullName == foo.bar.Bippy
sym.javaClassName == foo.bar.package.Bippy
*** End important note ***
There are many situations where we (until now) forewent revealing
everything we knew about a type mismatch. For instance, this isn't very
helpful of scalac (at least in those more common cases where you didn't
define type X on the previous repl line.)
scala> type X = Int
defined type alias X
scala> def f(x: X): Byte = x
<console>:8: error: type mismatch;
found : X
required: Byte
def f(x: X): Byte = x
^
Now it says:
found : X
(which expands to) Int
required: Byte
def f(x: X): Byte = x
^
In addition I rearchitected a number of methods involving:
- finding a symbol's owner
- calculating a symbol's name
- determining whether to print a prefix
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current design of error trees complicates the design of reflection
library, and introduces sometimes unnecessary boilerplate and since I
do not want to stall that work I am reverting all the changes related
to error trees. A different design is currently under consideration but
work will be done on separate branch on github.
Revisions that got reverted:
r25705, r25704 (partially), r25673, r25669, r25649, r25644, r25621, r25620, r25619
Review by odersky and extempore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are no more direct calls to context.error from Typers and Infer,
so more work needs to be done to finish it for Implicits and Namers.
I am pushing it to trunk so that all of you can share my pain (and
complain). Please do not add any more context.error randomly in that
code, instead deal with it appropriately (by creating specific error
tree).
I was trying to be as informative when it comes to error tree names
as possible, but if you feel like changing names to something more
appropriate then feel free to do so. When it comes to printing error
messages I tried to follow test suite as closily as possible but
obviously there were few changes to some tests (mostly positive, I
believe).
On my machine performance drawback was neglible but I am working on more
aggressive caching to reduce the penalty of containsError() calls even
more. Any suggestions welcome.
At the moment the code supports both styles i.e. throwing type errors
for the cases that are not yet handled and generating error trees. But
in the future we will drop the former completely (apart from cyclic
errors which can pop up almost everywhere).
Review by odersky, extempore and anyone who feels like it.
|
|
|