| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This works around SI-5736 that's been deemed too risky to be fixed in 2.10.0.
A reflection newbie will be unlikely to acquire a field symbol from its name,
but the `accessed` method provides an easy way to navigate to it from a getter.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Firstly this unifies the reflection API - now both decls and members
return Scope (not Scope and List[Symbol] as it were before).
Secondly this fixes SI-5732 without having to sort the result of members.
Type.members now returns Scope, a distinguished type, which has the
`sorted` method, which does the required sorting if necessary.
Also removes nonPrivateMembers and nonPrivateDeclarations to keep the API
minimalistic (as can be seen from their implementation in internal.Types
they are just members and decls with bridges and private members removed).
|
|\
| |
| | |
SI-5751 cleans up toolboxes for the release
|
| |
| |
| |
| |
| |
| |
| |
| | |
Removes the `freeTypes` parameters on `typeCheckExpr` and `runExpr`,
since we now have public `substituteTypes` on both trees and types.
Also implements long-awaited `inferImplicitValue` and `inferImplicitView`
(thanks to Miles Sabin for nudging me!)
|
|\ \
| |/
|/| |
Fixed maddening "..." lately in printed types.
|
| |
| |
| |
| |
| |
| | |
I screwed around with type printing for a long time and now I have
to be done, so I suggest we accept the imperfection in here for now
because it's still way ahead of "..." as types go.
|
|\ \
| | |
| | | |
SI-5866 Support casting null to value classes
|
| | |
| | |
| | |
| | | |
The fix now supports null.asInstanceOf[C] where C is a value class that wraps a primitive type.
|
|\ \ \
| | | |
| | | | |
ClassTag.Nothing now throws an exception
|
| |/ /
| | |
| | |
| | |
| | | |
Nothing is a bottom type, so it doesn't make much sense for it to have
a meaningful erasure (ClassTag.Nothing.runtimeClass).
|
|\ \ \
| | | |
| | | | |
Fixed SI-5031. Only consider classes when looking for companion class.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
sym.effectiveOwner revealed this piece of inconsistency. companionModule
is fine because similar check is there already.
Review by @paulp.
|
|\ \ \
| | | |
| | | | |
Closes SI-5882
|
| | | |
| | | |
| | | |
| | | | |
I changed the SIP and added a test.
|
| | | |
| | | |
| | | |
| | | | |
I have added a restriction that value classes may not contain inner classes or objects. This makes sense as the "outer" field of any such classes or objects would be ephemeral, with surprising results. SIP-15 has been changed accordingly.
|
|\ \ \ \
| | | | |
| | | | | |
SI-2038 make pt fully-defined when typing Typed
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
dropExistential turns existentials in the expected type (pt) that's passed to `typed`
into `BoundedWildcardType`s, but those should not end up in trees
when typing a `Typed` node, we didn't check for the type being fully defined (`isFullyDefined`)
(and thus did not make it fully defined by turning these BWTs into existentials again using `makeFullyDefined`)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Remove resolveOverloaded
|
| | |_|_|/
| |/| | |
| | | | |
| | | | | |
It was decided to remove it until the next release
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fixed SI-5603. Early definitions now get transparent positions.
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | | |
This includes a fix for a minor problem described in #594 -
ensureNonOverlapping still focuses on default position when outside of early defs.
Review by @dragos, @odersky.
|
|\ \ \ \
| | | | |
| | | | | |
Closes SI-5878
|
| | |_|/
| |/| |
| | | |
| | | | |
We need to impose an additional rule on value classes: They may not unbox directly or indirectly to themselves.
|
|\ \ \ \
| |_|/ /
|/| | | |
IDE improvements, with particular focus on making worksheets work.
|
| | | |
| | | |
| | | |
| | | | |
Adds a raw string interpolator raw"..." which does not do any escape sequence processing.
|
|\ \ \ \
| | | | |
| | | | | |
Partest instrumentation fixes
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Extend instrumenting infrastructure to instrument
classes in `instrumented` package. This is useful
because very often you need to put your classes
into non-empty package. E.g. inliner doesn't work
properly with empty package at the moment so in
order to test any behaviour we need to put classes
in some other package that is instrumented.
Added testing code for that to instrumentation
test-case.
Review by @phaller.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6140 Scaladoc infinite recursion in wiki parser
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
introduced by dc70d1b7.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Issue/4560
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Added all the known cases of failing self-types. Added tests for symbol
access (SI-4601) as well which should now be fixed for all of the same cases
as well.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Following this commit are reversions of three prior commits which
introduced difficulties of their own, plus extra tests for this
issue and SI-4601, all of which I pinched from jrudolph.
Maybe there was a good reason for some of the complicated code
related to this ticket. I took the naive position that if we avoided
generating a method call to a particular receiver if the receiver
has no such method, we would encounter fewer NoSuchMethodErrors.
I would believe one can construct a scenario which this doesn't
handle correctly, but it's hard to believe this isn't a big
improvement. Review by @jrudolph, @odersky.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6142: warn @inline-methods ending up not inlined (rightfully or not)
|
| | |/ / / /
| |/| | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-5958 This deserves a stable type
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`this` (or the self variable) passed as an actual argument to a method
should receive a singleton type when computing the method's resultType
this is necessary if the method's type depends on that argument
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | | |
... in a less nice way than I would like. Essentially, we mask type errors at later stages that arise from comparing existentials and skolems because we know that they are not tracked correctly through all tree transformations. Never mind that all these types are going erased anyway shortly afterwards. It does not smell nice. But as I write in the comment, maybe the best way out is to
avoid skolems altogether. Such a change by far exceeds the scope of this pull request however.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't warn on "uncheckable" type patterns if they can be
statically guaranteed, regardless of their runtime checkability.
This covers patterns like Seq[Any] and lots more.
Review by @adriaanm.
|
|\ \ \ \
| |/ / /
|/| | | |
SI-4440 workaround: avoid outer accessor that'll vanish
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
outer accessors of final classes are dropped in constructors
apply some foresight in explicit outer and replace those doomed outer checks by `true`
(since this is unfortunate, we generate an unchecked warning)
|
|\ \ \
| | | |
| | | | |
SI-6117 regression involving import ambiguity.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Today I learned that
foo.member("bar") != foo.member("bar")
if bar is overloaded, because each lookup of an overloaded member
creates a new symbol (with equivalent OverloadedTypes.) How should symbols
be compared so these do not appear unequal? Is there a method which
unpacks the alternatives and compares them individually? It seems likely
there are additional bugs which arise from not covering this case.
Since this bug is in the context of importing, if the prefixes are
identical then I can compare the names instead of the symbols and this
issue goes away. But for the rest of the time during which one might
encounter overloaded symbols, that would be a very lossy operation,
since the overloaded symbol might be encoding any subset of the members
with that name.
There are lots of references to "OverloadedSymbol" in the comments of
various methods in Types, but no such class is visible in the history.
If we had such a thing, we could refine its equals method to recognize
equivalent overloads.
Review by @odersky.
|
|\ \ \ \
| | | | |
| | | | | |
Improve unchecked warnings.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Spurious test was not good. Better test avoids suppressing
some legitimate warnings. Review by @moors.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
SI-6111 accept single-subpattern unapply pattern
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
An extractor pattern `X(p)` should type check for any `X.unapply`/`X.unapplySeq`
that returns an `Option[_]` -- previously we were confused about the case where
it was an `Option[(T1, ... , Tn)]`. In this case, the expected type for the
pattern `p` is simply `(T1, ... , Tn)`.
While I was at it, tried to clean up unapplyTypeList and friends (by replacing them by extractorFormalTypes).
From the spec:
8.1.8 ExtractorPatterns
An extractor pattern x(p1, ..., pn) where n ≥ 0 is of the same syntactic form as a constructor pattern.
However, instead of a case class, the stable identifier x denotes an object which has a member method named unapply or unapplySeq that matches the pattern.
An unapply method in an object x matches the pattern x(p1, ..., pn) if it takes exactly one argument and one of the following applies:
n = 0 and unapply’s result type is Boolean.
n = 1 and unapply’s result type is Option[T], for some type T.
the (only) argument pattern p1 is typed in turn with expected type T
n > 1 and unapply’s result type is Option[(T1, ..., Tn)], for some types T1, ..., Tn.
the argument patterns p1, ..., pn are typed in turn with expected types T1, ..., Tn
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Changed behavior so that when determining the target variance of a method parameter,
the variance in formals comes first. If variance is still undecided by that,
the variance in the result type is used as a secondary criterion.
(This is also done when determining prototype type params.)
|
|\ \ \
| |/ /
|/| | |
SI-6090 correct rewriting of overloaded value class ==
|
| | |
| | |
| | |
| | | |
Sharpens the test so that only Object_== and Object_!= methods on valueclasses may be rewritten in posterasure, whereas user-defined methods are not rewritten.
|
| |/
|/|
| |
| | |
test that matchEnd that's an argument of || that's in tail position is in tail position
|