aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/Desugar.scala
Commit message (Collapse)AuthorAgeFilesLines
* Move compiler and compiler tests to compiler dirFelix Mulder2016-11-221-1089/+0
|
* Merge pull request #1634 from dotty-staging/change-tasty-pos-ctdodersky2016-11-211-4/+3
|\ | | | | Towards correct positions in TASTY types
| * Make This and Super take idents as qualifier/mixinMartin Odersky2016-11-211-1/+1
| | | | | | | | | | The qualifier of a This and the mixin of a Super were names, which meant that their positions were lost. Now they are untyped idents.
| * Clean up parameterized typedefsMartin Odersky2016-11-111-3/+2
| | | | | | | | | | | | | | | | Express them in terms PolyTypeTrees rather than having an irregular, untyped only tparams field. This is necessary if we want to pickle type trees instead of types, because now the rhs of a typedef tells the whole story, so we are not required any longer to use the info of the symbol.
* | Don't allow redefinition of core classesMartin Odersky2016-11-101-8/+24
|/ | | | Fixes #1688.
* Use inline flag instead of @inline annotationMartin Odersky2016-11-071-2/+1
| | | | | Convert `@inline` annotations to `inline` flags, not the other way round as was done before.
* Update IllegalVariableInPatternAlternative error messageShane Delmore2016-10-251-1/+1
|
* Improved error messages in Desugar.scalaShane Delmore2016-10-191-4/+4
|
* Improve positions for MemberDefs using `namePos`Felix Mulder2016-10-101-2/+5
|
* Inline argument closures to inline methodsMartin Odersky2016-10-021-2/+8
| | | | | | If an argumnet to an inline method refers to a closure that is the result of eta-expanding another inline method inline the argument method.
* Make Context#moreProperties strongly typedMartin Odersky2016-10-021-2/+2
| | | | To do this, factor out Key from Attachment into a new type, Property.Key.
* Drop PairMartin Odersky2016-09-251-26/+9
| | | | | | | | Drop tree node class 'Pair'. It was used only in imports, where it can easily be replaced by Thicket. The envisaged use for generic pairs is almost sure better modelled by a "Pair" class in Dotty's standard library.
* Make InterpolatedString conform to ordering requirementMartin Odersky2016-09-241-3/+11
| | | | Arrange its sub-elements so that they appear strictly left to right.
* Swap order of elements in AnnotatedMartin Odersky2016-09-241-5/+5
| | | | | | | | | Now it's annotated first, annotation second. This is in line with AnnotatedType and in line with the principle that tree arguments should come in the order they are written. The reason why the order was swapped before is historical - Scala2 did it that way.
* Make positions fit for metaMartin Odersky2016-09-241-14/+18
| | | | | | | | | | | | | | | | | | In particular: - get rid of envelope, it's too complicated and hides too many errors - check that everywhere in parsed trees the position range of a parent node contains the position ranges of its children. - check that all non-empty trees coming from parser have positions. The commit contains lots of fixes to make these checks pass. In particular, it changes the scheme how definitions are positioned. Previously the position of a definition was the token range of the name defined by it. That does obviously not work with the parent/children invariant. Now, the position is the whole definition range, with the point at the defined name (care is taken to not count backticks). Namer is changed to still use the token range of defined name as the position of the symbol.
* Merge pull request #1534 from OlivierBlanvillain/clean-up-printersFelix Mulder2016-09-231-1/+0
|\ | | | | Clean up config.Printers imports
| * Clean up config.Printers importsOlivier Blanvillain2016-09-231-1/+0
| | | | | | | | And remove the not used Printer#echo
* | Fix #1503 - be careful where to insert an apply.Martin Odersky2016-09-171-1/+1
|/ | | | | | `apply` nodes should not be inserted in the result parts of a block, if-then-else, match, or try. Instead they should be added to the surrounding statement.
* Identation/spacing cleanupOlivier Blanvillain2016-09-081-1/+1
|
* Implement alternative desugaring of for-if to filter.Martin Odersky2016-08-261-2/+14
| | | | | | | Fallback to .filter if a .withFilter is not available, but do this only for .withFilter calls generated from for expressions (this is different from what scalac does; the latter can also rewrite .withFilter calls given in source, which is not desirable.
* implementation of exhaustivity and redundancy checkliu fengyun2016-08-241-6/+10
|
* Fix #1432: Fix desugaring of Bind(WILDCARD, _).Nicolas Stucki2016-08-151-2/+2
|
* Turn on new hk schemeMartin Odersky2016-07-111-1/+1
| | | | | | | For the moment under newHK flag. - avoid crasher in derivedTypeParams (NamedTypes don't always have symbols) - Revise logic in type comparer for new HK scheme
* Fix typo in Desugar#refinedTypeToClass documentationGuillaume Martres2016-05-281-1/+1
|
* Ensure more things are completedMartin Odersky2016-04-291-1/+5
| | | | | | | As noticed by @smarter we need to ensure that classes owning derived type params are completed, so that trees get the proper symbol attachments. This triggered when I changed annotation transformers - I have no idea whether how two could be related, though.
* Add companions to value classes during desugaringsMartin Odersky2016-04-151-1/+17
| | | | | | | | | | | | | | | | | This means companions will be pickled and we can drop the special treatement in transformInfo of FirstTransform. That method is problematic, since it enters new symbols into a class scope. This is not allowed, since transformInfo needs to be purely functional, side effects are not permitted (`enteredAfter` does not work either). The problem manifested itself when compiling colltest5 with a requirement failure in the code of `entered` when called from FirstTransform (trying to enter in a frozen class). TODO: Once we use statics for LazyVals we can get rid of the "add companion object" logic in FirstTransform alltogether.
* Fix #1216 Desugar: vals that are desugared PatDef may need setters.Dmitry Petrashko2016-04-141-2/+5
| | | | | | Setters are normally synthesised in Desugar while expanding the ValDef. If the tree is a PatDef it is being desugared into several ValDefs that may need to be desugared once again.
* Move Mode to coreMartin Odersky2016-04-011-1/+0
| | | | | Mode is used from a lot of low-level code, does not just reflect Typer info. So it makes more sense top to place it in the core package.
* Merge pull request #1166 from dotty-staging/fix-#1136odersky2016-03-181-1/+1
|\ | | | | Fix typing of SeqLiterals
| * Add second field to SeqLiteralMartin Odersky2016-03-101-1/+1
| | | | | | | | | | | | | | The field keeps track of the element type. This is necessary because JavaSeqLiteral is nonvariant and the elements might be empty, so we cannot always compute the type from the element types.
* | Address reviewer comments.Martin Odersky2016-03-141-2/+2
| |
* | Copy full modifiers to companionsMartin Odersky2016-03-121-7/+6
| |
* | Fix desugaring of lazy patterns.Martin Odersky2016-03-121-8/+15
|/ | | | Selectors should be defs, not lazy vals.
* Merge pull request #1111 from dotty-staging/fix-#1099Dmitry Petrashko2016-03-021-14/+30
|\ | | | | Special case pattern matching against abstract types with class tags
| * Fix desugaring of classes with context boundsMartin Odersky2016-02-201-14/+30
| | | | | | | | | | | | | | | | | | Context bounds did not make it before into secondary constructors. Now the evidence parameters generated by context bounds get copied into secondary constructors. Without this fix, scala.collection.immutable.PagedSeq fails to compile in new classtag scheme.
* | Don't copy annotations from method to default getter.Martin Odersky2016-02-201-1/+1
| |
* | Default getters accessibility fixMartin Odersky2016-02-201-1/+1
|/ | | | | | Default getters should have same accessibility as the method they belong to. Previously, it was the accessibility of the parameter, which makes no sense. Fixes #1116.
* Merge pull request #1066 from dotty-staging/fix-#997odersky2016-02-191-5/+7
|\ | | | | Fix #997
| * Copy access flags to derived definitions during desugaringMartin Odersky2016-02-191-5/+7
| | | | | | | | Previously, some definitions were too public, others too private.
* | Fix assertion error messageMartin Odersky2016-02-191-1/+1
|/
* Untuple using `def` not `val`.Martin Odersky2016-02-161-4/+5
| | | | As retronym noted on #897, `val` forces to early.
* Auto-uncurry n-ary functions.Martin Odersky2016-02-161-0/+19
| | | | Implements SIP #897.
* Add position to implicit defs generated from implicit classes.Martin Odersky2015-12-191-1/+2
|
* Fix desugaring of symbols.Martin Odersky2015-12-191-1/+1
| | | | Symbols can appear in patterns, so inserting an `apply` is wrong.
* Generalize overriding checking from isDefinedMartin Odersky2015-12-141-0/+7
| | | | | | | | Generalize overriding checking from isDefined to all methods added by desugar to a case class. None of these methods has an override so we need to add one in case they do override another method (previously we would flag this as an error).
* Desugar#makeAnnotated: Avoid unnecessary typingGuillaume Martres2015-12-011-1/+1
| | | | The less typing we do during Namer, the better.
* More refined treatement of pattern type variablesMartin Odersky2015-11-171-0/+6
| | | | | | | | | | | | | | | Previously all lower case names were treated as variables in patterns. But that made code like x: cls crash the compiler if `cls` was a class. Also, it owuld preventing this idiom unless one wrote x: `cls` We now do it like scalac and treat lower case names as variables only in arguments of types.
* Avoid taking references before toplevel symbols are entered.Martin Odersky2015-11-091-1/+1
| | | | | | | | 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.
* Rename AnnotRef -> AnnotTypeMartin Odersky2015-11-091-1/+1
|
* Shorten ..Class.typeRef to ..TypeMartin Odersky2015-11-091-4/+4
| | | | | Since we now have two forms of (almost) everything in Definitions, might as well profit from it.