aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/TypeErasure.scala
Commit message (Collapse)AuthorAgeFilesLines
* Alternative fixMartin Odersky2017-04-181-2/+6
| | | | | Special case HKApply only. This is simpler and potentially more efficient.
* Dealias before type erasingMartin Odersky2017-04-181-2/+2
| | | | | | ... and likewise for taking a signature. The previous case worked in all cases except when faced with an alias like `type Id[T] = T`. In that case, it would disregard the argument and erase to Object.
* Make PolyType a ground typeMartin Odersky2017-04-061-0/+4
| | | | | It's too surprising to leave it as a type proxy. In all circumstances except erasure, it is not true that a PolyType is somehow the same as its result type.
* replace derived{Method,Poly}Type with derivedLambdaTypeMartin Odersky2017-04-061-3/+3
|
* Rename PolyParam --> TypeParamRefMartin Odersky2017-04-061-3/+3
|
* Harmonize paramTypes and paramBoundsMartin Odersky2017-04-061-4/+4
| | | | | | MethodTypes have paramTypes whereas PolyTypes have paramBounds. We now harmonize by alling both paramInfos, and parameterizing types that will become common to both.
* Merge pull request #2043 from dotty-staging/tailrec-derivesFromDmitry Petrashko2017-03-151-1/+2
|\ | | | | Tailrec for derivesFrom/lookupRefined/classSymbol/classSymbols
| * Add @tailrec to avoid regressions.Nicolas Stucki2017-03-011-1/+2
| |
* | Fix #2066: Don't qualify private members in SelectionProto's...Martin Odersky2017-03-121-2/+2
| | | | | | | | ... unless they would be accessible in the given context.
* | Fix bug in erasedLub leading to incorrect signaturesGuillaume Martres2017-03-081-4/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the added testcase failed in a strange way: 14 | def bla(foo: Foo) = orElse2(identity).apply(foo) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |value of type <nonsensical><notype></nonsensical> does not take parameters This happened because the TermRef for the apply method had an incorrect signature, therefore its underlying type was NoType. According to the documentation of `erasedLub`, the erasure should be: "a common superclass or trait S of the argument classes, with the following two properties: S is minimal: no other common superclass or trait derives from S] S is last : in the linearization of the first argument type `tp1` there are no minimal common superclasses or traits that come after S. (the reason to pick last is that we prefer classes over traits that way)." I'm not convinced that the implementation satisfies either of these two properties, but this commit at least makes S closer to being minimal by making sure that the last best candidate never derives from it.
* Add checks for synthetic functions and erased functions.Nicolas Stucki2017-02-131-6/+5
| | | | | | | | * Add `isSyntheticFunction` checks for synthetic functions such as FuntionN for N > 22 and ImplicitFunctionN for N >= 0. * Add `erasedFunctionClass` to get the erased verion of synthetic functions. * Change the semantics of `isFunctionClass` to return true if it is any kind of FunctionN or ImplicitFunctionN.
* Fix #1916: fix erasure of implicit xxl closuresNicolas Stucki2017-02-031-2/+2
| | | | This commit extends the fix done in #1920 to implicit closures.
* Merge pull request #1775 from dotty-staging/add-implicit-funtypesodersky2016-12-181-3/+10
|\ | | | | Add implicit function types
| * Fix erasure of implicit functionsMartin Odersky2016-12-171-1/+1
| | | | | | | | and check at runtime that it works
| * Handle erasure of implicit function typesMartin Odersky2016-12-171-2/+9
| |
* | Make errors are not swept under the carpetMartin Odersky2016-12-171-3/+3
|/ | | | | | | | | Typer#ensureReported's comment outlines an example where errors could go unreported, resulting in error trees after typer without any reported error messages. This commit makes sure that at least one error is reported if a tree node has an error type. Fixes #1802.
* Merge pull request #1682 from dotty-staging/vclassodersky2016-12-151-1/+1
|\ | | | | Fix checks related to value classes
| * fix #1642: disallow value classe wrapping value classliu fengyun2016-11-241-1/+1
| |
* | Drop function 22 limit.Martin Odersky2016-11-301-3/+14
|/ | | | | | | | | | | | | | | | | | | Functions with more than 22 parameters are now automatically converted to functions taking a single object array parameter. This has been achieved by tweaking erasure. Other things I have tried that did ot work out well: - Use a single function type in typer. The problem with this one which could not be circumvented was that existing higher-kinded code with e.g. Funcor assumes that Functon1 is a binary type constructor. - Have a late phase that converts to FunctonXXL instead of doing it in erasure. The problem with that one was that potentially every type could be affected, which was ill-suited to the architecture of a miniphase.
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-0/+514