summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
Commit message (Collapse)AuthorAgeFilesLines
...
| * Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
| |
* | Removing unused locals and making vars into vals.Paul Phillips2012-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to "git diff" the difference from master to this commit includes: Minus: 112 vals, 135 vars Plus: 165 vals, 2 vars Assuming all the removed ones were vals, which is true from 10K feet, it suggests I removed 80 unused vals and turned 133 vars into vals. There are a few other -Xlint driven improvements bundled with this, like putting double-parentheses around Some((x, y)) so it doesn't trigger the "adapting argument list" warning.
* | Merge remote-tracking branch 'upstream/2.10.x' into merge-210Lukas Rytz2012-08-161-2/+2
|\| | | | | | | | | | | | | Required a few changes of `HIDDEN` -> `ARTIFACT` and `isHidden` -> `isArtifact` Conflicts: src/reflect/scala/reflect/internal/Flags.scala
* | Merge branch '2.10.x'Adriaan Moors2012-08-081-1/+1
|\| | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/TreeGen.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
| * 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 ```
* | Expanded use of HIDDEN flag.Paul Phillips2012-07-191-2/+2
|/ | | | | | | | | | | | | | | | | | | | Like the comment says: /** Symbols which are marked HIDDEN. (Expand this list?) * * - $outer fields and accessors * - super accessors * - protected accessors * - lazy local accessors * - bridge methods * - default argument getters * - evaluation-order preserving locals for right-associative and out-of-order named arguments * - catch-expression storing vals * - anything else which feels a setFlag(HIDDEN) */ I also changed a few safe-appearing locations to check isHidden rather than isSynthetic. Review by @dragos, @odersky.
* Allow attachments for symbols, just like for trees.Lukas Rytz2012-07-051-2/+13
| | | | Removes the two global hash maps in Namers, and the one in NamesDefaults. Also fixes SI-5975.
* removes array tagsEugene Burmako2012-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* moves positions to scala.reflect.internal.utilEugene Burmako2012-06-081-1/+1
| | | | This is the first step of factoring out scala-reflect.jar.
* removes tags and their incantations from PredefEugene Burmako2012-06-081-0/+1
| | | | | | All tags and reflection-related stuff requires a prefix, be it scala.reflect for simple tags (ArrayTags and ClassTags), or scala.reflect.basis/scala.reflect.runtime.universe for type tags.
* Widen types in names/defaults transformations.Paul Phillips2012-05-231-13/+12
| | | | | | | | We were getting away with this somehow, but the types are wrong after typer and that sort of thing is noticed by more people now. I took the opportunity to add our first -Ycheck:all test, which is at least as much about helping -Ycheck:all remain in good working order as it is about this test.
* Better diagnosis for the SI-5044 fixHubert Plociniczak2012-05-221-0/+4
|
* Merge pull request #578 from lrytz/wip/t5044-squashedAdriaan Moors2012-05-191-2/+9
|\ | | | | fix SI-5044: better error message on cyclic error and named/default args
| * better feedback for SI-5044Lukas Rytz2012-05-181-2/+9
| |
* | Merge pull request #566 from lrytz/wip/t4928Adriaan Moors2012-05-181-10/+15
|\ \ | | | | | | Fix SI-4928
| * | Fix SI-4928Lukas Rytz2012-05-161-10/+15
| |/ | | | | | | better error message when a parameter is first defined positionally, then with a named argument.
* / Fix SI-5259Lukas Rytz2012-05-151-6/+6
|/ | | | Calling the type checker on an Ident tree instead of using gen.mkAttributedRef assigns a SingleType to the tree.
* Fixed positions in named default applications (no hyperlinking in ↵Iulian Dragos2012-05-081-1/+1
| | | | | | conjunction with implicit arguments). Removed even more code in the presentation compiler testing infrastructure. One less level of indirection, and a top-level object gone!
* SI-5720: Qual block doesn't update sym ownerSom Snytt2012-05-021-0/+2
| | | | | | A one-line change to blockWithQualifier. The symptom is undefined tmp var symbols in the backend; lamba lift thinks the tmp var is free and adds it to anonfun ctors.
* Fighting bitrot with typing.Paul Phillips2012-04-291-10/+1
| | | | | | | | if (false && settings.debug.value) { ... } Date: 7 years ago *** empty log message *** That's way past the sell-by date for 'if (false && condition)'.
* migrates stdlib and compiler to tagsEugene Burmako2012-04-231-2/+2
| | | | | * all usages of ClassManifest and Manifest are replaced with tags * all manifest tests are replaced with tag tests
* Enabling postfix ops feature warning, and working on libs to avoid them.Martin Odersky2012-04-121-1/+1
|
* Fix memory leak related to default arguments in presentation compiler.Lukas Rytz2012-04-101-1/+2
| | | | | | | | | | | This bug exists for a long time, but was triggered / discovered only lately by the default argument of mkParams in 118aef558f. This reverts the workaroud commit 19b6ad5ee4. The fix is tested by test/files/presentation/memory-leaks which runs the presentation compiler several times on Typers.scala. I could not reproduce the memory leak in a smaller test case.
* A boatload of work on Symbols and Flags.Paul Phillips2012-04-051-2/+2
| | | | | | | Finally my dream of orderliness is within sight. It's all pretty self-explanatory. More polymorphism, more immutable identity, more invariants.
* Merge branch 'master' into merge-inlinePaul Phillips2012-03-141-13/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/scala-compiler.jar.desired.sha1 lib/scala-library-src.jar.desired.sha1 lib/scala-library.jar.desired.sha1 src/compiler/scala/reflect/internal/Definitions.scala src/compiler/scala/reflect/internal/Importers.scala src/compiler/scala/reflect/internal/Symbols.scala src/compiler/scala/reflect/internal/Trees.scala src/compiler/scala/reflect/internal/Types.scala src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/transform/LiftCode.scala src/compiler/scala/tools/nsc/transform/UnCurry.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/run/programmatic-main.check test/files/speclib/instrumented.jar.desired.sha1
| * Whitespace commit.Paul Phillips2012-02-291-4/+4
| | | | | | | | | | | | | | Removed all the trailing whitespace to make eugene happier. Will try to keep it that way by protecting at the merge level. Left the tabs in place because they can't be uniformly changed to spaces, some are 2, some are 4, some are 8, whee.
| * One more to derive trees.Paul Phillips2012-02-231-9/+5
| | | | | | | | | | | | ClassDefs, CaseDefs, and LabelDefs. Dotting eyes, crossing tees. Point of diminishing returns is reached, declare victory and withdraw.
* | Made Any parents work more.Paul Phillips2012-02-041-1/+1
|/ | | | Working on type printing logic.
* Use context for buffering errors that cannot/shouldn't be reported in the ↵Hubert Plociniczak2012-01-251-16/+14
| | | | | | | | given moment (instead of throwing type errors). This avoids previous problems where we were creating fake error trees in some incorrect places like in type completers in Namers etc. Implicits relied heavily on type errors being thrown but performance should stay the same due to some explicit checks/returns. Some of the problems involved how ambiguous error messages were collected/reported because it was very random (similarly for divergent implicits). This should be more explicit now. Reduced the number of unnecessary cyclic references being thrown (apart from those in Symbols/Types which don't have a context and need to stay for now as is). Review by @paulp, @odersky.
* Symbol creation followup.Paul Phillips2012-01-161-4/+3
| | | | | | Changed most symbol creations to be consistent with all the others. Opportunistically streamlined various call sites. Moved some phase-specific methods out of Symbol to somewhere more appropriate (like that phase.)
* Optimizing TypeRef, starting with Symbols.Paul Phillips2012-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are too many potential optimizations unavailable to us due to the lack of bright lines among different kinds of symbols. For instance the difference between a TypeSymbol which represents a type alias and one which represents an abstract type is only whether the DEFERRED flag is set. This creates issues. 1) There are many (many) places where tests are performed on every symbol which could be done more efficiently and (especially) more verifiably correctly with polymorphism. 2) TypeRefs based on those symbols are also checking that flag constantly, in perpetuity. A symbol created as an alias is never (to the best of my knowledge) going to intentionally morph into one representing an abstract type, nor vice versa. 3) One has no guarantees, because anyone can set or reset the DEFERRED flag at any time. So tackling more than one problem at once herein: 1) I created canonical symbol creation points which take the flags as an argument, so that there can be a difference between initializing a symbol's flags and setting/resetting them at arbitrary times. 2) I structured all the symbol creators to take arguments in the same order, which is: def newXXX(name: Name, ..., pos: Position = NoPosition, flags: Long = 0L) (Where "..." is for those symbols which require something beyond the name to create, such as a TypeSkolem's origin.) The name is first because it's the only always required argument. I left but deprecated the variations which take (pos, name). 3) I created subclasses of TypeRef based on the information which should be stable from creation time onward: - args or no args? - abstract type, type alias, or class? 2x3 == 6 and that's how many subclasses of TypeRef there are now. So now, for example, every TypeRef doesn't have to carry null symInfoCache and thisInfoCache fields for the benefit of the minority which use them. I still intend to realize the gain possible once we can evade the fields for pre and args without losing pattern matcher efficiency.
* More performance work.Paul Phillips2011-12-301-125/+118
| | | | | | | Custom versions of collections which methods which operate on 2 or 3 collections. Eliminated most users of zip/zipped. Cleaned up the kinds checking code somewhat. Reduced the number of silent typechecks being performed at named argument sites.
* More warnings eliminations.Paul Phillips2011-12-071-2/+2
| | | | | Deprecation warnings, unchecked warnings, "that's not the value you think it is" warnings. Also eliminated a warning by fixing a warning bug.
* Fix documentation stutters.Blair Zajac2011-12-061-1/+1
|
* Renamed isPureExpr to isExprSafeToInline.Paul Phillips2011-10-131-4/+4
| | | | | | Taking adriaan's advice for what name would better describe this method. Yours in reduction of ambiguous terminology, no review.
* Back to square one.Hubert Plociniczak2011-09-231-33/+39
| | | | | | | | | | | | | | Current design of error trees complicates the design of reflection library, and introduces sometimes unnecessary boilerplate and since I do not want to stall that work I am reverting all the changes related to error trees. A different design is currently under consideration but work will be done on separate branch on github. Revisions that got reverted: r25705, r25704 (partially), r25673, r25669, r25649, r25644, r25621, r25620, r25619 Review by odersky and extempore.
* More work on error trees.Paul Phillips2011-09-171-1/+1
| | | | | | | | | | | extempore can't live with that level of duplication. I eliminated 400 lines. I could eliminate more: there are distinctions which seem unimportant, but I'm not sure so I left them in place. Example, is a "ContextError" something meaningful other than "an error which one emits by calling context.error"? Review by plocinic.
* First refactoring related to Error trees.Hubert Plociniczak2011-09-071-39/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no more direct calls to context.error from Typers and Infer, so more work needs to be done to finish it for Implicits and Namers. I am pushing it to trunk so that all of you can share my pain (and complain). Please do not add any more context.error randomly in that code, instead deal with it appropriately (by creating specific error tree). I was trying to be as informative when it comes to error tree names as possible, but if you feel like changing names to something more appropriate then feel free to do so. When it comes to printing error messages I tried to follow test suite as closily as possible but obviously there were few changes to some tests (mostly positive, I believe). On my machine performance drawback was neglible but I am working on more aggressive caching to reduce the penalty of containsError() calls even more. Any suggestions welcome. At the moment the code supports both styles i.e. throwing type errors for the cases that are not yet handled and generating error trees. But in the future we will drop the former completely (apart from cyclic errors which can pop up almost everywhere). Review by odersky, extempore and anyone who feels like it.
* Fixed bug in the disambiguation of f(foo='bar')...Paul Phillips2011-08-061-9/+8
| | | | | | | | Fixed bug in the disambiguation of f(foo='bar') style method calls in the presence of overloading, parameterization, and by-name arguments. Took the opportunity to clean things up a little bit. Closes SI-4592, review by rytz.
* Adding some Sets/Maps to perRunCaches, and elim...Paul Phillips2011-07-141-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding some Sets/Maps to perRunCaches, and eliminating ambiguously named imports. Did a tour of the compiler adding a few longer-lived mutable structures to the per-run cache clearing mechanism. Some of these were not a big threat, but there is (almost) literally no cost to tracking them and the fewer mutable structures which are created "lone wolf style" the easier it is to spot the one playing by his own rules. While I was at it I followed through on long held ambition to eliminate the importing of highly ambiguous names like "Map" and "HashSet" from the mutable and immutable packages. I didn't quite manage elimination but it's pretty close. Something potentially as pernicious which I didn't do much about is this import: import scala.collection._ Imagine coming across that one on lines 407 and 474 of a 1271 file. That's not cool. Some poor future programmer will be on line 1100 and use "Map[A, B]" in some function and only after the product has shipped will it be discovered that the signature is wrong and the rocket will now be crashing into the mountainside straightaway. No review.
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-181-5/+5
|
* close #4524 and close #4425, review by odersky.Lukas Rytz2011-05-051-1/+6
|
* fix #4502 and fix #4430. review by odersky.Lukas Rytz2011-05-051-10/+15
|
* close #4041. review by extemporeLukas Rytz2011-03-181-13/+22
|
* Some cleanup from investigating #4041, with a c...Paul Phillips2011-02-091-10/+26
| | | | | | Some cleanup from investigating #4041, with a comment instead of a fix for the ticket. Review by rytz in case he sees a good way to fix it.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* second version of close #3649. no reviewLukas Rytz2011-01-181-12/+16
|
* Removing code which I believe to be some debugg...Hubert Plociniczak2011-01-181-16/+1
| | | | | | Removing code which I believe to be some debugging statements. Causes infinite loop anyway. Review by odersky
* Made NamesDefault more robust to support idempo...Martin Odersky2011-01-071-2/+6
| | | | | Made NamesDefault more robust to support idempotent compilation.
* More fixes to avoid the dreaded "NoSymbol does ...Martin Odersky2010-12-181-1/+17
| | | | | | More fixes to avoid the dreaded "NoSymbol does not have owner" problem in names defaults.