aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #928 from dotty-staging/stdlib-definitionsDmitry Petrashko2015-11-1056-494/+703
|\ | | | | Make Definitions survive recompilation of core definitions.
| * Get more info on HeisenbugsMartin Odersky2015-11-092-1/+21
| | | | | | | | | | | | 1) Check that searched scope is consistent 2) Do a linear search for symbol with name, and report if something was found that way.
| * Print missing ref diagnostics on stderrMartin Odersky2015-11-091-2/+2
| | | | | | | | Was stdout, but this gets mixed up with the exception printing on stderr.
| * Avoid cyclic reference errors when unpickling classesMartin Odersky2015-11-092-6/+10
| | | | | | | | | | | | | | Set info early in order to avoid cyclic reference errors. Errors were observed when compiling scala/Predef.scala scala/package.scala scala/collection/GenSeqLike.scala
| * Don't inspect info when dealiasing classesMartin Odersky2015-11-091-2/+3
| | | | | | | | | | | | | | Forces a bit less, and could be more efficient. Did not seem to make a difference with current CyclicReferences though, except that cyclic error happened a bit later in the sequence.
| * Better diagnosis from completions printerMartin Odersky2015-11-092-1/+13
| | | | | | | | Track starts and ends of completions using indentation.
| * More info when TreeChecker failsMartin Odersky2015-11-091-1/+1
| | | | | | | | Now also provides compilation unit.
| * Trying to get more diagnostics out of TreeCheckerMartin Odersky2015-11-091-0/+4
| | | | | | | | Again it dies without an exception trace. Is partest eating error output?
| * Make dir.list synchronized.Martin Odersky2015-11-091-2/+5
| | | | | | | | | | Just a grap at straws to get a handle for the missing reference problem.
| * More refined Retyping tracingMartin Odersky2015-11-091-3/+4
| | | | | | | | | | | | Instead of simply dropping all Retyper error traces, we now send them to the config.Printers.transforms printer, so what happens depends on the value of that printer.
| * Disable "Exception while typing" trace in retyper.Martin Odersky2015-11-091-2/+2
| | | | | | | | | | | | I looked a some of the failures so far, and in each case we got a huge "exception while typing" cascade but then no actual error! Buffer overflow? To find out more I disabled the trace for now.
| * Generalize MultiArrayOf to arrays of wildcardsMartin Odersky2015-11-092-5/+21
| | | | | | | | | | Needed for both ClassTags and instance of checks. This makes scala/Array.scala compile.
| * Avoid taking references before toplevel symbols are entered.Martin Odersky2015-11-095-7/+7
| | | | | | | | | | | | | | | | Taking a reference means that the symbol will be brought forward into the current run, then if the same symbol is entered from source, a datarace ensues. This affected the ProductN symbols because these are automatically added to a case class suring desugaring.
| * Don't try to transform sources of primitive value classes after FrontEnd.Martin Odersky2015-11-091-1/+14
| |
| * Make symbol methods in Definitions depend on implicit contextMartin Odersky2015-11-092-103/+120
| | | | | | | | | | | | | | Otherwise they would always return the symbol in the original context where Definitions was first created. Also, cache two more arrays of symbols per run.
| * Rename AnnotRef -> AnnotTypeMartin Odersky2015-11-093-58/+57
| |
| * Shorten ..Class.typeRef to ..TypeMartin Odersky2015-11-0917-43/+43
| | | | | | | | | | Since we now have two forms of (almost) everything in Definitions, might as well profit from it.
| * Fix dotty compilation problem in DefinitionsMartin Odersky2015-11-091-4/+4
| |
| * Renamings in DefinitionsMartin Odersky2015-11-0920-163/+140
| | | | | | | | | | | | TypeRef becomes Type, thus removing duplicates. Where ...Type was used in an extraction (e.g. ArrayType(...), FunctionType(...)), we now use ...Of.
| * Avoid overhead of generating symbol sets on each accessMartin Odersky2015-11-0912-36/+49
| | | | | | | | | | | | 1) Have symbol sets cached per run 2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass instead of calling contains directly on symbol sets.
| * Make Set[TypeRef]s privateMartin Odersky2015-11-091-5/+5
| | | | | | | | Contains tests on thsoe sets would be flakey anyway.
| * Remove/hide value class mapsMartin Odersky2015-11-092-17/+14
| | | | | | | | | | | | | | Remove unneeded maps and make the ones that are needed private. Reason: Maps indexed with TypeNames are prone to misuse; should be accessed only with names of known primitive classes.
| * Move refType/Class maps from Definitions to CapturedVarsMartin Odersky2015-11-092-20/+27
| | | | | | | | | | | | | | Maps should not have TypeRefs as keys, yet symbols are not stable for recompilation. Solution: Construct these maps over symbols but move them to CapturedVars#Transform where they will be re-built on each run.
| * Make BoxedUnit_UNIT a defMartin Odersky2015-11-091-2/+1
| | | | | | | | Was a lazy val, but this is not stable under recompilation.
| * Match on _name rather than TypeRef in scalaPrimitivesMartin Odersky2015-11-092-32/+32
| |
| * Standardize requiredMethod callsMartin Odersky2015-11-095-44/+34
| | | | | | | | | | Remve versions in Symbols, always go through version in Denotations. Avoids having two equivalent ways to do the same thing.
| * Standardize naming and definition order of annotation classesMartin Odersky2015-11-093-28/+28
| |
| * Use more standard way to define LanguageModuleClassMartin Odersky2015-11-091-3/+3
| |
| * Make isPolymorphicAfterErasure a methodMartin Odersky2015-11-091-2/+2
| | | | | | | | | | Can't be a lazy val, because one of the symbols it tests (`newRefArray`) can be recomputed.
| * Harmonize naming conventions for BoxedUnitMartin Odersky2015-11-092-5/+3
| | | | | | | | Also, delete unused `uncheckedStableClassRef` entry.
| * Index primitive value class maps by name, not TypeRefMartin Odersky2015-11-092-16/+18
| | | | | | | | | | TypeRefs can have several representations for logically the same type, so they don't make good keys.
| * First versions of Definitions based on TypeRefs not Symbols.Martin Odersky2015-11-0923-351/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbols are not stable between runs, so if some symbol referred to from Definitions gets recompiled, there are then two Symbols that are both visible, one referenced from Definitions, the other the one that got compiled. Thos led to a crash when e.g. compiling scala.Short, because the newly compiled symbol was not recognized as a primitive value class. The present commit tries to make systematic changes without regard to simplicity or aesthetics. This will be polished in future commits. // ### comments signal areas that need further attention.
* | CrossCastAnd: reimplement it in more compact way.Dmitry Petrashko2015-11-101-23/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that there is a slight difference in behaviour: it will be unconditionally adding cast even if its not needed. For example in callsFoo1 cast is not needed(erasure will insert a correct one). ``` class A{ private def foo = 1 def callsFoo1(other: A & B): Int = other.foo def callsFoo2(other: B & A): Int = other.foo } trait B { def foo(i: Int) = i } ``` Though as AndTypes are uncommon I do not expect this to have non-negligible impact on performance.
* | CrossCastAnd: Fix issue with Phases.Dmitry Petrashko2015-11-101-1/+1
| | | | | | | | | | Right part of and type should not be widened, as dotty could have used non-widened type to drive type inference.
* | New phase: crossCastAnd.Dmitry Petrashko2015-11-102-0/+49
| | | | | | | | | | | | | | This transform makes sure that all private member selections from AndTypes are performed from the first component of AndType. This is needed for correctness of erasure. See `tests/run/PrivateAnd.scala`
* | Tailrec: fix compilation of IndexedSeqOptimizedDmitry Petrashko2015-11-091-1/+1
|/ | | | Fixed #912
* Merge pull request #899 from dotty-staging/fix-#880Dmitry Petrashko2015-11-091-3/+8
|\ | | | | Require outer pointer also for proxies of enclosing classes.
| * Require outer pointer also for proxies of enclosing classes.Martin Odersky2015-10-311-3/+8
| | | | | | | | There was a missing case where an outer pointer is required.
* | Merge pull request #927 from dotty-staging/stdlib-boundsodersky2015-11-095-12/+14
|\ \ | | | | | | Drop checking that lower bound is a subtype of upper bound.
| * | Check bounds of inferred typevars in PostTyper.Martin Odersky2015-11-053-10/+12
| | |
| * | Add more info on missing references in unpickler.Martin Odersky2015-11-051-0/+2
| | | | | | | | | | | | Trying to hunt down the flakey build.
| * | Drop test that lower bound must be a subtype of upper bound.Martin Odersky2015-11-051-2/+0
| | | | | | | | | | | | | | | | | | As discussed in #780 and #525, the test is not needed. This makes t1279a compile, which got moved now to pos. Fixes #780 and #915. It also makes scala.List compile. Review by @smarter.
* | | Merge pull request #905 from dotty-staging/fix-nested-pkg-member-2odersky2015-11-091-1/+3
|\ \ \ | | | | | | | | Fix nested pkg member 2
| * | | Fix problem when accessing same identifier from nested packages.Martin Odersky2015-11-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous rules picked the once outer removed member rather than the innermost one, of both members exist. Seen in the wild in scala.sys.ShutdownHookThread. No separate test here, because we'll include large parts of stdlib anyway as a build test.
* | | | Merge pull request #902 from dotty-staging/fix-numeric-implicit-argsodersky2015-11-093-6/+32
|\| | | | | | | | | | | Fix numeric implicit args
| * | | Disable failing testMartin Odersky2015-11-011-5/+5
| | | | | | | | | | | | | | | | | | | | Dotty delivers an ambiguity error. The comment in the test argues why this is OK.
| * | | Better handling of implicits over numeric types.Martin Odersky2015-11-013-6/+32
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiling scala.math.BigDecimal and scala.math.BigInteger shows a problem. The conversion `int2bigInt` is not applicable to a Byte because `Byte -> Int` requires another implicit conversion. We fix that by using a new method relaxed_<:< for implicit compatibility checks, which always admits numeric widenings. This leads to another problem. Now the conversions implicit def byteToInt(x: Byte): Int implicit def byteToShort(x: Byte): Short are ambiguous when we try to convert from Byte to Int. We fix that by adding a "tie-break" to implicit search where if several methods match a numeric value result type and all have numeric value types as result types, we pick the numerically largest type that matches.
* | | Avoid spurious procedure syntax migration warningMartin Odersky2015-11-091-1/+1
| | |
* | | Remove println accidentally left in code.Martin Odersky2015-11-051-3/+1
| | |
* | | Handle variance unsoundness in scalacMartin Odersky2015-11-051-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The included test pos-special/variances-constr.scala demonstrates an unsoundness in the variance checking of scalac. Scalac excludes symbols owned by constructors from the checking. This is unsound, as can be demonstrated by compiling the test and observing output of the program run: Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at Test$.main(variances-constr.scala:17) at Test.main(variances-constr.scala) Dotty allows this code only under -language:Scala2 and issues a migration warning.