summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
Commit message (Collapse)AuthorAgeFilesLines
* Clarify how/when typedFunction unrolls eta-expansionAdriaan Moors2016-03-311-16/+21
| | | | | | | Jason points out the recursion will be okay if type checking the function inside the eta-expansion provides fully determined argument types, as the result type is not relevant for this phase of typedFunction.
* typedFunction undoes eta-expansion regardless of expected typeAdriaan Moors2016-03-301-15/+0
| | | | | | When recovering missing argument types for an eta-expanded method value, rework the expected type to a method type.
* Merge pull request #2327 from paulp/pr/2315-rebasedPaul Phillips2013-04-021-1/+1
|\ | | | | SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag
| * SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlagSom Snytt2013-03-271-1/+1
| | | | | | | | | | | | | | This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
* | Merge commit '395e90a786' into pr/merge-395e90a786Paul Phillips2013-03-281-0/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | * commit '395e90a786': SI-7251, compiler crash with $. SI-7240 fixes language feature lookup SI-7233 Account for aliased imports in Erasure SI-7233 Account for aliased imports in eta expansion. SI-7132 - don't discard Unit type in interpreter SI-6725 `f` interpolator now supports %n tokens Conflicts: src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala src/repl/scala/tools/nsc/interpreter/ExprTyper.scala
| * SI-7233 Account for aliased imports in eta expansion.Jason Zaugg2013-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buggy: treeCopy.Select(sel, sel.qual, sel.name) setSymbol null Select(sel, sel.qual, sel.name) Okay: treeCopy.Select(sel, sel.qual, sel.name) Select(sel, sel.qual, sel.symbol.name) // but doesn't copyAttrs! It is an easy mistake to make, I've found one more occurance: def foo(a: Any) = { import a.{toString => toS}; toS } error: uncaught exception during compilation: scala.reflect.internal.FatalError scala.reflect.internal.FatalError: class Object does not have a member toS at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1028) A followup commit will address that problem.
* | Doc -> C-style comments for local symbols to avoid "discardingEugene Vigdorchik2013-03-211-4/+3
| | | | | | | | | | unmoored doc comment" warning when building distribution for scala itself.
* | Name boolean arguments in src/compiler.Jason Zaugg2013-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | What would you prefer? adaptToMemberWithArgs(tree, qual, name, mode, false, false) Or: adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
* | Eliminating var-like setter tpe_= on Tree.Paul Phillips2012-12-191-3/+3
| | | | | | | | | | | | | | | | | | Deprecated tpe_= on Tree, which is redundant with and less useful than setType. To provide a small layer of insulation from the direct nulling out of mutable fields used to signal the typer, added def clearType() which is merely tree.tpe = null but is shamefaced about the null and var-settings parts like a respectable method should be.
* | Removing ancient comments and pointless comments.Paul Phillips2012-11-191-6/+3
| | | | | | | | | | | | | | | | | | | | Translating <code></code> into backticks. Removed the "@param tree ..." blocks which have been taunting me for half a decade now. Removed commented-out blocks of code which had been sitting there for two years or more.
* | Merge commit 'refs/pull/1574/head' into merge-210Paul Phillips2012-11-051-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1574/head': (24 commits) Fixing issue where OSGi bundles weren't getting used for distribution. Fixes example in Type.asSeenFrom Fix for SI-6600, regression with ScalaNumber. SI-6562 Fix crash with class nested in @inline method Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013 Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013 SI-6606 Drops new icons in, replaces abstract types placeholder icons SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings Labeling scala.reflect and scala.reflect.macros experimental in the API docs Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later SI-6399 Adds API docs for Any and AnyVal Removing actors-migration from main repository so it can live on elsewhere. Fix for SI-6597, implicit case class crasher. SI-6578 Harden against synthetics being added more than once. SI-6556 no assert for surprising ctor result type Removing actors-migration from main repository so it can live on elsewhere. Fixes SI-6500 by making erasure more regular. Modification to SI-6534 patch. Fixes SI-6559 - StringContext not using passed in escape function. ... Conflicts: src/actors-migration/scala/actors/migration/StashingActor.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/library/scala/Application.scala src/library/scala/collection/immutable/GenIterable.scala.disabled src/library/scala/collection/immutable/GenMap.scala.disabled src/library/scala/collection/immutable/GenSeq.scala.disabled src/library/scala/collection/immutable/GenSet.scala.disabled src/library/scala/collection/immutable/GenTraversable.scala.disabled src/library/scala/collection/mutable/GenIterable.scala.disabled src/library/scala/collection/mutable/GenMap.scala.disabled src/library/scala/collection/mutable/GenSeq.scala.disabled src/library/scala/collection/mutable/GenSet.scala.disabled src/library/scala/collection/mutable/GenTraversable.scala.disabled src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
| * Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
| |
* | Fix for SI-5859, inapplicable varargs.Paul Phillips2012-09-291-1/+1
|/ | | | And other polishing related to varargs handling.
* SI-6274 Fix owners when eta-expanding function with byName paramLukas Rytz2012-09-041-2/+6
| | | | | | | | | | | | | When eta-expanding a function that takes a by-name param the local definition for the corresponding argument is a function-0 val eta$1 = () => { argument-to-by-name } If there are any definitinos in the `argument-to-by-name`, the symbol owner needs to be changed to the anonymous function's symbol. To know the function symbol in eta expand, we need to type-check the function, and therefore pass the `Typer` instance to `etaExpand`.
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* Merge pull request #771 from retronym/ticket/4176-2Adriaan Moors2012-07-021-4/+13
|\ | | | | SI-4176 A repeat dose of repeated parameter type sanitization.
| * SI-4176 A repeat dose of repeated parameter type sanitization.Jason Zaugg2012-06-301-4/+13
| | | | | | | | | | | | | | - During eta expansion, treat parameters of type A* as Seq[A] - Do the same for method/class parameters as referred to by an Ident. Also fixes SI-5967, which shows up during pattern matching.
* | SI-5966 Fix eta expansion for repeated parameters with zero arguments.Jason Zaugg2012-06-231-3/+5
|/ | | | | Reworks part of e33901 / SI-5610, which was inserting an <empty> tree as an argument in this case, which turns into a null in icode.
* Fix for SI-5610Lukas Rytz2012-05-151-5/+11
|
* Renamed isPureExpr to isExprSafeToInline.Paul Phillips2011-10-131-1/+1
| | | | | | Taking adriaan's advice for what name would better describe this method. Yours in reduction of ambiguous terminology, no review.
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-181-1/+1
|
* Proliferating the number of debugging modes bec...Paul Phillips2011-06-061-1/+1
| | | | | | | | | | | | | | Proliferating the number of debugging modes because it's still way too hard to see what's going on in there. Until we get hubert's type debugger with its whiz-bang whizbanginess, we'll have to struggle along with somewhat prettier ascii. This introduces: -Yinfer-debug which tries to print in readable fashion what is happening in the worlds of inference and implicit search. It should be made a bit more complementary and less overlappy with -Ytyper-debug. No review.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Removed the Name => TypeName implicit conversion.Paul Phillips2011-01-011-2/+2
| | | | | | | | | | questions start to arise as the ability to distinguish between type and term names becomes more fully realized: particularly that the ability to distinguish between TermSymbols and TypeSymbols has not come along with the names. In any case, this is more tedious than I might have anticipated but mostly because it's blazing a trail of typiness to ease the path for others. No review.
* It's a big one!Paul Phillips2010-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TermName and TypeName are exposed throughout the compiler based on what kind of name a given abstraction ought to have. (There remain places where one needs to create a name without knowing yet what it will be, and those will always be Names.) The nme object in the compiler now holds only term names. To reference a known type name, use tpnme: nme.List == ("List": TermName) tpnme.List == ("List": TypeName) The contents of nme and tpname are defined in traits, many of which are shared, so if a name should exist only as a Type and not a Term, it should be defined in CompilerTypeNames, but otherwise in CompilerTermNames or CompilerCommonNames. This is partially complete but I'm sure there are still many shared which should pick a side. Usage of .toTermName and .toTypeName is strongly discouraged. After the dust has settled, there will be very few places where it will make sense to hop between namespaces like that. There are some implicits to smooth everything out, most of which should be removable eventually. // these two are in no hurry to go anywhere String => TermName String => TypeName // but not String => Name: def view in the compiler is no longer implicit // these two are temporary, and can log when they kick off to help us flush // out remaining issues of "name migration" Name => TermName Name => TypeName There is more work to be done before we're properly protected from naming errors, but I will not allow another eight hour tragedy to befall lukas or anyone else! Review by rytz. (Formality.)
* There was a fascinating tangle of name creation...Paul Phillips2010-10-151-16/+3
| | | | | | | | | | | | | | | There was a fascinating tangle of name creation functions passing around positions only to reach the end of the line and discard the position since names don't have positions. I deleted all of it. The winner for most creative use of parameters was the freshName function in etaExpand, with this signature: def freshName(pos: util.Position, n: Int) And an implementation referencing neither pos nor n. "In a world beset by attrition on all sides... a people defeated by entropy... one man will show them the power of deletion." No review.
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* As a brief diversion from real work, implemente...Paul Phillips2010-04-061-1/+1
| | | | | | | | | As a brief diversion from real work, implemented Damerau–Levenshtein and ran it on trunk to elicit obvious misspellings. Unfortunately they're mostly in places like compiler comments which real people never see, but I fixed them anyway. All those English Lit majors who peruse our sources are sure to be pleased. No review.
* lifted out core compiler data structures into r...Martin Odersky2010-02-011-3/+1
| | | | | | lifted out core compiler data structures into reflect.generic package. Made Unpickler work on generic data.
* Made some cosmetic but clarity-increasing chang...Paul Phillips2010-01-201-1/+1
| | | | | | | | | Made some cosmetic but clarity-increasing changes to a few files. Primarily, used corresponds where possible rather than zipped.forall. Added isImplicit and isJava to MethodType so the relevant subtypes could be determined without the hideous isInstanceOf checks. Review by odersky.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* Deprecation patrol exercises the new capabiliti...Paul Phillips2009-11-191-5/+6
| | | | | | Deprecation patrol exercises the new capabilities in Tuple2.zipped among other exciting no-ops.
* new starr, with some changes to varargs handling.Martin Odersky2009-09-171-0/+1
|
* Deprecation patrol.Paul Phillips2009-08-221-1/+1
|
* rewrite of positions in compilerMartin Odersky2009-07-301-5/+8
|
* switch to unnested packages.Martin Odersky2009-07-241-1/+2
|
* Fixed positionsMartin Odersky2009-07-051-9/+7
|
* cleaned up eta-expansion of partial named appli...Lukas Rytz2009-06-161-0/+10
| | | | | cleaned up eta-expansion of partial named applications
* Named and default argumentsLukas Rytz2009-05-301-6/+6
| | | | | | | - MethodTypes now have (params: List[Symbol]) - "copy"-methods for case classes - the "copy" object in the compiler is now called "treeCopy"
* more work on rangepositions.Martin Odersky2009-05-281-1/+0
|
* Unreasonably satisfying patch which sets immuta...Paul Phillips2009-05-201-13/+9
| | | | | | Unreasonably satisfying patch which sets immutable final val inIDE = false and then performs dead code elimination (human style.)
* Updated (all) copyright notices to 2009Antonio Cunei2009-01-131-1/+1
|
* fixed #807. More stuff for virtual classes.Martin Odersky2008-05-301-7/+2
|
* (1) Removed generation of $tag method for inter...Martin Odersky2008-04-071-0/+13
| | | | | | (1) Removed generation of $tag method for interfaces (2) improved type inference for clsoures (3) redesign of CharSequence and regex.
* Another massive IDE checkin.Sean McDirmid2008-01-271-9/+6
|
* fixed several problems with implicits. Martin Odersky2007-10-311-2/+9
| | | | | | Changed ways inner types of modules print: Module.this.Type => Module.type
* Fixing a bug with long lists in GenerateIDESyms...Sean McDirmid2007-10-041-1/+2
| | | | | | Fixing a bug with long lists in GenerateIDESyms and a fresh name problem in ETA expansion with respect to the IDE.
* Fixed method freshName to return distinct names.Iulian Dragos2007-10-021-1/+1
|
* Massive check-in for IDE.Sean McDirmid2007-09-171-5/+21
|
* some fix for bug1279Martin Odersky2007-08-211-1/+5
| | | | | applied Koltsov patch