aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
Commit message (Collapse)AuthorAgeFilesLines
* Move `eqNullable` check to `assumedCanEqual`Felix Mulder2016-12-191-20/+12
|
* Fix #1793: allow multiversal comparisons between Null and XFelix Mulder2016-12-191-2/+20
|
* Merge pull request #1775 from dotty-staging/add-implicit-funtypesodersky2016-12-186-54/+114
|\ | | | | Add implicit function types
| * Fix "wrong number of args" reportingMartin Odersky2016-12-173-6/+7
| | | | | | | | | | | | "Wrong number of args" only works for type arguments but was called also for term arguments. Ideally we should have a WrongNumberOfArgs message that works for both, but this will take some refactoring.
| * Don't look at nesting for implicit resolution under Scala2 mode.Martin Odersky2016-12-171-1/+6
| |
| * Create implicit closures to math expected implicit functionsMartin Odersky2016-12-172-13/+28
| | | | | | | | | | When the expected type is an implicit function, create an implicit closure to match it.
| * Take nesting into account when ranking implicitsMartin Odersky2016-12-174-31/+59
| | | | | | | | | | | | This will need a spec change. It's necessary in order not to confuse synthetic implicits with each other or with explicit ones in the environment.
| * Refactor function operations in DefinitionsMartin Odersky2016-12-172-4/+6
| | | | | | | | | | | | | | | | | | Also: show implicit function types correctly. Also: refine applications of implicit funcitons - don't do it for closure trees - don't do it after typer.
| * Always insert apply for expressions of implicit function typeMartin Odersky2016-12-171-8/+13
| |
| * Add syntax for implicit functionsMartin Odersky2016-12-171-2/+6
| |
* | Merge pull request #1817 from dotty-staging/fix-#1802odersky2016-12-186-24/+34
|\ \ | | | | | | Fix #1802: Make sure errors are not swept under the carpet
| * | Make errors are not swept under the carpetMartin Odersky2016-12-176-24/+34
| |/ | | | | | | | | | | | | | | | | 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.
* / Infer type parameters of anonymous class parents from expected typeMartin Odersky2016-12-173-5/+22
|/ | | | | | | If a parent type of an anonymous class is an Ident or Select which refers to a parameterized type, use the expected type to infer its type parameters. Fixes #1803.
* Merge pull request #1801 from dotty-staging/fix-#1790Dmitry Petrashko2016-12-161-18/+52
|\ | | | | Fix #1790: Change by-name pattern matching.
| * Implement new rules for name-based pattern matchingMartin Odersky2016-12-151-17/+27
| | | | | | | | This implements the rules laid down in #1805.
| * Change by-name pattern matching.Martin Odersky2016-12-141-19/+43
| | | | | | | | New implementation following the scheme outlined in #1790.
* | Merge pull request #1785 from dotty-staging/fix-#1784odersky2016-12-155-8/+19
|\ \ | | | | | | Fix #1784: allow to omit types for local implicit vals
| * | Add CyclicImplicitVal error to messages (reverted from commit ↵Martin Odersky2016-12-151-2/+4
| | | | | | | | | | | | 559e49317912ce52c51e295346cebcafbb69462d)
| * | Add CyclicImplicitVal error to messagesFelix Mulder2016-12-131-4/+2
| | |
| * | Drop "Dotty deviation" messages that are no longer applicable.Martin Odersky2016-12-121-1/+1
| | |
| * | Better diagnosis for cyclic references caused by implicit searchMartin Odersky2016-12-122-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since we now allow to drop the explicit type of a local implicit val it can happen that this causes a cyclic reference, namely when the typechecking of the right-hand side involves an implicit search. It's unpractical and fragile to avoid this. Instead we give now a nice error message explaining the problem and how to fix it in source code.
| * | Drop explicit types for local implicit valsMartin Odersky2016-12-123-3/+3
| | | | | | | | | | | | | | | Drop explicit types for local implicit vals of type Context and Position. Exercises the functionality and shortens the code.
| * | Fix #1784: allow to omit types for local implicit valsMartin Odersky2016-12-121-3/+9
| | |
* | | Merge pull request #1682 from dotty-staging/vclassodersky2016-12-153-38/+50
|\ \ \ | |_|/ |/| | Fix checks related to value classes
| * | don't recheck in -Ycheckliu fengyun2016-11-243-41/+47
| | |
| * | fix #1642: disallow value classe wrapping value classliu fengyun2016-11-242-3/+5
| | |
| * | fix #1670: move the check of value class to typerliu fengyun2016-11-242-2/+6
| | |
* | | Fix #1786: support use package object in fun callliu fengyun2016-12-131-1/+1
| |/ |/|
* | Merge pull request #1764 from dotty-staging/fix-#1757odersky2016-12-104-11/+43
|\ \ | | | | | | Fix #1757: Be more careful about positions of type variable binders
| * | Add explanationMartin Odersky2016-12-021-0/+22
| | |
| * | Fix #1757: Be more careful about positions of type variable bindersMartin Odersky2016-12-014-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We interpolate a type variable if the current tree contains the type variables binding tree. Previously, this was the application owning the variable. However, sometimes this tree is transformed so that the containment test fails, and type variables are instantiated too late (in the case of #1757 this was never). We fix this by - setting the binding tree to the type tree that first contains the type variable - making sure that tree is never copied literally anywhere else. It's a tricky dance, but I believe we got it right now.
* | | Merge pull request #1658 from dotty-staging/fix-#1639odersky2016-12-033-49/+91
|\ \ \ | |/ / |/| | Fix #1639: Changes around implicits and apply methods
| * | Avoid inserting multiple .apply's.Martin Odersky2016-11-242-11/+25
| | | | | | | | | | | | | | | | | | This can lead to stackoverflow, as i1639.scala shows. Fixes #1639.
| * | Avoid recomputation of companionRefsMartin Odersky2016-11-241-31/+30
| | | | | | | | | | | | | | | | | | | | | When tracing i1639.scala it became apparent that we compute a lot of companion refs. This commit avoids this by better book-keeping what is valid and what is not and more aggressive caching.
| * | Better reporting of nested implicit failuresMartin Odersky2016-11-241-8/+37
| | | | | | | | | | | | | | | Error messages of nested implicit failures are now reported with the top-level message if -explaintypes is set.
* | | Address reviewers commentsMartin Odersky2016-12-012-3/+7
| | |
* | | Fix #1647 Evaluate annotation arguments in proper contextMartin Odersky2016-12-011-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | Need to evaluate annotation arguments in an expression context, since classes defined in asuch arguments should not be entered into enclosing class. Fixes #1647
* | | New phase for entering annotationsMartin Odersky2016-12-014-27/+104
| | | | | | | | | | | | | | | | | | If we want to do annotation macros right, we need to add annotations before completing definitions. This commit achieves that by adding a new "phase" between index and typecheck.
* | | Fix import disablingMartin Odersky2016-12-012-21/+33
| | | | | | | | | | | | It was broken before, since it worked only on wildcard imports.
* | | Be more lazy in namedImportRefMartin Odersky2016-12-011-21/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got a hard to track down error when changing to the new annotations elaboration scheme (should be in the next commit): When running `testNonCyclic`, `DotClass` was not found in object Trees even though it was imported from `util`. It turned out that the import was ignored because the `util` symbol was completing. This commit adds a warning when this happens. The warning currently applies only to named imports because several false negatives were encountered if we do this also on wildcard imports. I.e. we get a warning, but the searched after symbol is not a member of the wildcard qualifier. This commit also refactors namedImportRef, so that `site` is only computed when the name to reseolve appears in the selector list. That change made the previously observed error go away because less is now forced.
* / Enable GADT matching for pattern valuesMartin Odersky2016-11-241-1/+3
|/ | | | | So far, only typed patterns an dunapply had GADT matching. i1737.scala shows that we need to do the same thing for objects.
* Revert fix to #1701.Martin Odersky2016-11-241-5/+10
| | | | | | | | | | | Fengyun's original solution was the right one. We cannot NOT enter a package class into its parent scope, because reloading the denotation with .member will fail. So we need to enter it and compensate by adding a clause to `qualifies` in `typedIdent`. Weirdly, this was noted only when running tasty_bootstrap from a custom classpath in the new build setup. So it was pretty tricky to diagnose.
* checkNoPrivateLeaks: handle defs in local classesGuillaume Martres2016-11-221-1/+1
| | | | | | The access boundary of a def in a local class is the owner of that class, previously it was set to the access boundary of the owner of the class instead.
* checkNoPrivateLeaks: handle references to companion membersGuillaume Martres2016-11-221-2/+16
| | | | | | | | | | | Previously Outer2#Inner#foo failed to compile with: ``` non-private method foo refers to private value x in its type signature ``` This should compile because the boundary of `foo` is `class Outer2` and the boundary of `x` is `object Outer2`. This commit fixes this by also considering the linked boundary in `checkNoPrivateLeaks`.
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-2220-0/+10462