aboutsummaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* deferredAnnot: Avoid harmless capture of ContextGuillaume Martres2017-02-181-2/+3
| | | | | The capture context was only used to get its phase so shouldn't cause any problem.
* Merge pull request #1989 from dotty-staging/remove/scalac-testsGuillaume Martres2017-02-181-1/+0
|\ | | | | Disable tests that require scala-compiler
| * Disable tests that require scala-compilerGuillaume Martres2017-02-181-1/+0
| | | | | | | | This is necessary if we ever want to get rid of our dependency on scala-compiler
* | Merge pull request #1972 from dotty-staging/fix/inline-errorsodersky2017-02-182-6/+10
|\ \ | | | | | | TreeMap/TreeAccumulator: proper context for inlined trees
| * | TreeMap/TreeAccumulator: proper context for inlined treesGuillaume Martres2017-02-132-6/+10
| | | | | | | | | | | | | | | | | | This was already be done in TreeTraverser but should also be done in TreeMap and TreeAccumulator for ctx.error(..., tree.pos) to not use completely incorrect positions inside inlined trees.
* | | Merge pull request #1995 from dotty-staging/fix/private-leaks-posodersky2017-02-181-5/+4
|\ \ \ | | | | | | | | checkNoPrivateLeaks: Use correct position for errors
| * | | checkNoPrivateLeaks: Use correct position for errorsGuillaume Martres2017-02-171-5/+4
| | |/ | |/| | | | | | | | | | | | | | | | Previously we never used the `pos` argument of `checkNoPrivateLeaks` and instead used `sym.pos`, this makes a difference for calls to `avoidPrivateLeaks` coming from `TreeUnpickler` where we should use `tree.pos` instead.
* | | Fix binding of x @ (e: T) in ClassTag-based patmatGuillaume Martres2017-02-171-7/+5
| | | | | | | | | | | | | | | | | | We cannot assume that the untyped rhs of the bind is a `Typed` tree, with extractors it might be an `Apply` node, and in general it might also be a `Parens` node.
* | | Fix #1991: Use classtag where available in unapplyMartin Odersky2017-02-172-14/+21
|/ /
* | Merge pull request #1962 from dotty-staging/centralize-function-logicodersky2017-02-167-52/+111
|\ \ | | | | | | Factor out logic for scala functions.
| * | Add checks for synthetic functions and erased functions.Nicolas Stucki2017-02-137-52/+111
| |/ | | | | | | | | | | | | | | * 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.
* | Change '... expected but found ...' to MessageEnno Runne2017-02-146-13/+75
| |
* | Fix #1976: Hack to support scala.xml's $scope (#1977)odersky2017-02-144-1/+8
| | | | | | | | | | | | This is a gross hack to support the need for a $scope binding when XML literals are created. It should go away once we phase out XML literals. A library-based solution should use implicits instead.
* | Merge pull request #1979 from dotty-staging/fix-#1975Felix Mulder2017-02-141-5/+7
|\ \ | | | | | | Fix #1975: Align valdefs and for expressions for patterns
| * | Fix #1975: Align valdefs and for expressions for patternsMartin Odersky2017-02-141-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | val definitions and for expressions both distinguish whether something is a pattern or a variable binding. They no do it the same way: `ident` or an `ident: type` is a variable binding, everything else is a pattern. Previously, capitalized idents were considered as bindings in valdefs but as pattern in fors.
* | | increase command wait time to 1sliu fengyun2017-02-141-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change helps to reduce non-determinism in the test. The problem can happen when two consecute commands interfere: [expect] [jdb] cmd1 ----> sleep 0.5 <--- part 1 of rep1 read & match buffer clear buffer cmd2 ----> <--- part 2 of rep1
* / Ennru forward reference error (#1973)Enno2017-02-143-3/+44
|/ | | | | | | | | | * Change 'forward reference extending over the definition' to Message * Change 'forward reference extending over the definition' to Message * pesky file should not be included * Change 'forward reference extending over the definition' to Message (test case)
* Merge pull request #1931 from dotty-staging/fix-#1501Guillaume Martres2017-02-134-3/+30
|\ | | | | Fix #1501 - Check trait inheritance condition
| * Fix package name of Java's Serializable classMartin Odersky2017-02-101-1/+1
| | | | | | | | It's java.io, not java.lang.
| * Narrow Java exception to inheritance ruleMartin Odersky2017-02-081-3/+5
| | | | | | | | | | Excepted are only Serializable and Comparable. This follows scalac's behavior.
| * Refine AnonClass generationMartin Odersky2017-02-081-1/+1
| | | | | | | | | | | | | | | | | | The leading class should be the superclass of the first trait (which is not always Object). We could think of a more refined condition, (i.e. taking the least common superclass of all extended traits), but I think it's not worth it, as one can always spell out the right superclass manually.
| * Refine checkTraitInheritance conditionMartin Odersky2017-02-081-3/+16
| | | | | | | | | | | | | | | | Need to take account of situations like extends Any with java.io.Serializable which occur in stdlib.
| * Fix #1501 - Check trait inheritance conditionMartin Odersky2017-02-082-1/+13
| | | | | | | | | | We need to check a coherence condition between the superclass of a trait and the superclass of an inheriting class or trait.
* | Merge pull request #1951 from dotty-staging/fix-1484Felix Mulder2017-02-134-2/+207
|\ \ | | | | | | fix #1484: position of while incorrect in debug
| * | remove noise in test outputliu fengyun2017-02-111-4/+7
| | |
| * | remove dependency on scala scriptliu fengyun2017-02-103-172/+182
| | |
| * | fix #1484: position of while incorrect in debugliu fengyun2017-02-103-2/+194
| | |
* | | Merge pull request #1969 from dotty-staging/fix/annot-funGuillaume Martres2017-02-131-1/+5
|\ \ \ | | | | | | | | Fix parsing annotation on function type
| * | | Fix parsing annotation on function typeGuillaume Martres2017-02-121-1/+5
| | | |
* | | | Change 'overrides nothing' to report via Message (see #1965) (#1968)Enno2017-02-123-6/+81
| | | | | | | | | | | | | | | | | | | | | | | | * Change 'overrides nothing' to report via Message, split into two different messages * Change 'overrides nothing' to report via Message, split into two different messages
* | | | Support expecting compiler errors from all phasesEnno Runne2017-02-102-4/+4
| |/ / |/| |
* | | Address reviews for #1966Felix Mulder2017-02-102-10/+12
| | |
* | | Make DottyTest a TraitFelix Mulder2017-02-102-3/+3
| | |
* | | Fix #1965: add proper testing infrastructure for reporting testsFelix Mulder2017-02-103-1/+116
|/ /
* | Merge pull request #1936 from dotty-staging/fix-1916-on-implicit-functionsodersky2017-02-083-6/+6
|\ \ | | | | | | Fix #1916: fix erasure of implicit xxl closures
| * | Fix #1916: fix erasure of implicit xxl closuresNicolas Stucki2017-02-033-6/+6
| | | | | | | | | | | | This commit extends the fix done in #1920 to implicit closures.
* | | Merge pull request #1921 from dotty-staging/fix-#1907odersky2017-02-082-33/+49
|\ \ \ | | | | | | | | Fix #1907: Improve error message
| * | | Improve formattingMartin Odersky2017-02-011-14/+19
| | | |
| * | | Disallow taking a class tag of Nothing or Null.Martin Odersky2017-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems in most cases this leads to weird behavior and cause confusing error messages later. It also means we cannot create an Array[Nothing], except by passing the classtag explicitly.
| * | | Handle Array classtags in the same way as othersMartin Odersky2017-02-011-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | The previous implicit definition of arrayTag in DottyPredef priorities arrayTag over all other classtag searches, which led to surprising results in `i1907a.scala`.
| * | | Print typerstate nesting info as part of constr printingMartin Odersky2017-01-312-5/+11
| | | | | | | | | | | | | | | | | | | | When printing info about adding to constraints, show the hashes of the typerstate stack, so that we know where constraints are added.
| * | | Implement SearchResult.showMartin Odersky2017-01-313-5/+31
| | | |
| * | | Allow implicit-by-name parametersMartin Odersky2017-01-312-7/+4
| | | |
| * | | Avoid recomputation of companionRefsMartin Odersky2017-01-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous condition for caching companionRefs contained a condition result.companionRefs.forall(implicitScopeCache.contains) which was always false because we cache types in `implicitCodeCache`, not companion refs. The new logic fixes this and does not need a second traversal because it is integrated in `iscopeRefs`.
* | | | Merge pull request #1941 from dotty-staging/fix/infix-posodersky2017-02-089-43/+46
|\ \ \ \ | | | | | | | | | | Better positions for infix operations
| * | | | Better positions for infix term operations.Guillaume Martres2017-02-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preserving the position of infix operators is useful for IDEs' type-at-point. We also preserve the position of the untyped lhs of right-associative operators, this is useful both for IDEs and for error messages, before: 4 |val x: List[Int] = "foo" :: List(1) | ^ | found: String($1$) | required: Int | After: scala> val x: List[Int] = "foo" :: List(1) -- [E007] Type Mismatch Error: <console> --------------------------------------- 4 |val x: List[Int] = "foo" :: List(1) | ^^^^^ | found: String($1$) | required: Int | Note: It would be even nicer if we displayed "String" instead of "String($1$)" since $1$ is synthetic, this commit does not address this.
| * | | | Represent untyped operators as Ident instead of NameGuillaume Martres2017-02-059-43/+44
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | This has two advantages: - We can distinguish BackquotedIdent from Ident, allowing the user to use a defined "type `&`", see testcase. - We get better positions for the operators. This is useful in IDEs, for example to get the type at point.
* | | | Merge pull request #1943 from dotty-staging/fix/lambda-positionodersky2017-02-081-0/+2
|\ \ \ \ | | | | | | | | | | Positioned#initialPos: Union the position of every children
| * | | | Positioned#initialPos: Union the position of every childrenGuillaume Martres2017-02-051-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | Previously we missed some children, one consequence of this is that the position of the typed tree corresponding to the lambda "z => 1" did not contain the position of "z".
* | | | Merge pull request #1952 from dotty-staging/fix/object-namePosodersky2017-02-081-2/+2
|\ \ \ \ | | | | | | | | | | Trees#namePos: Correct position for objects