summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Fixes to value classes: Flags now double definitions, private constructors ↵Martin Odersky2012-03-061-2/+4
| | | | as errors. Fixed erasure scheme.
* Added check that primary constructor of a value class must be public.Martin Odersky2012-03-051-6/+9
|
* Now spots double definition after erasure errors involving value classes.Martin Odersky2012-03-051-2/+3
|
* Made new automatic version of mkCast more robust for non-standard ↵Martin Odersky2012-02-232-4/+10
| | | | compilation setups by refining the logic what it means to be after a phase.
* Compiler now ready to accept value classes in standard library. Time for a ↵Martin Odersky2012-02-221-1/+1
| | | | new STARR!
* Fixes in namers and extension methods to support nested value classes and ↵Martin Odersky2012-02-222-6/+14
| | | | generic value classes.
* Enable derived value classes with an underlying field of a type parameter. ↵Martin Odersky2012-02-221-2/+0
| | | | They are too useful to ban.
* Make this substituter on trees also act on types, just as the other tree ↵Martin Odersky2012-02-221-3/+9
| | | | substitutres do.
* Changed erasure boxing/unboxing scheme to support value classes that wrap ↵Martin Odersky2012-02-223-20/+53
| | | | reference classes.
* Allowing for protected methods in value classes.Martin Odersky2012-02-221-1/+1
|
* Moved mkCast and derived method from reflect.internal.TreeGen to ↵Martin Odersky2012-02-222-37/+35
| | | | tools.nsc.ast.TreeGen. Made mkCast generate the "right" version of casts according to current phase.
* Made TreePrinters print classes that extend from AnyVal. For Paul to check ↵Martin Odersky2012-02-221-5/+5
| | | | if OK and remove commented code if that's the case.
* Made changeOwner more robust; now also deals with return expressions.Martin Odersky2012-02-221-5/+9
|
* Renamed "inline class" to "derived value class"Martin Odersky2012-02-209-48/+55
|
* Removed one more stone the parser threw at me for daring to have new value ↵Martin Odersky2012-02-202-4/+6
| | | | classes in the Scala library.
* Implemented super access in value classes, restrictions for value classes.Martin Odersky2012-02-194-14/+24
|
* Trying generic value classes. Does not work yet, but fixed on bug already.Martin Odersky2012-02-151-2/+2
|
* Changed array erasure scheme to never unbox elements of inline classes.Martin Odersky2012-02-155-72/+72
|
* Changed erasure behavior of arrays to use always boxed representation.Martin Odersky2012-02-142-47/+53
| | | | | | Conflicts: test/files/run/Meter.scala
* Refactoring to control the effects of inline erasure, restricting them to ↵Martin Odersky2012-02-143-37/+51
| | | | just the erasure phase and its actions.
* Fixing problems with generation of isInstanceOf, classOf.Martin Odersky2012-02-141-2/+6
|
* Setting up things to demonstrate a swallowed type error in manifest generation.Martin Odersky2012-02-133-15/+24
|
* Added missing files from last commitMartin Odersky2012-02-131-0/+61
|
* All steps of value class proposal implemented. Most restrictions are now ↵Martin Odersky2012-02-138-140/+258
| | | | enforced. Super calls and specialized still missing.
* wip. Getting started on erasing inline classes.Martin Odersky2012-02-085-85/+150
|
* Fixes supercalls tyo AnyVal constructors. Meter example now compiles and ↵Martin Odersky2012-02-081-24/+29
| | | | runs correctly (but no erasure yet).
* Rename isValueClass -> isPrimitiveValueClassMartin Odersky2012-02-0715-128/+122
|
* Making the Meter test expand and compile.Martin Odersky2012-02-074-23/+23
|
* Removing unnecessary AnyVal code.Paul Phillips2012-02-063-54/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...since it works from source. The parser must be forcibly restrained from adding a bogus constructor, but other than that it's pretty much smooth sailing. To give an idea how smooth, if I change scala.Short like so: trait Bippy extends Any final class Short extends AnyVal with Bippy Then it just works, at least until the fiction is revealed. scala> def f(x: Bippy) = x f: (x: Bippy)Bippy scala> f(5) <console>:9: error: type mismatch; found : Int(5) required: Bippy f(5) ^ scala> f(5: Short) java.lang.ClassCastException: java.lang.Short cannot be cast to scala.Bippy at .<init>(<console>:9) at .<clinit>(<console>) at .<init>(<console>:11)
* Merge branch 'master' into topic/inlinePaul Phillips2012-02-0627-338/+308
|\ | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/Global.scala test/files/run/programmatic-main.check
| *---. Merge remote-tracking branches 'rklaehn/SI-5139', 'axel22/feature/pc-ctrie', ↵Paul Phillips2012-02-0627-338/+308
| |\ \ \ | | | | | | | | | | | | | | | 'greedy/auto-fetch-jars', 'scalamacros/pullrequest/assorted' and 'VladUreche/feature/scaladoc-nofail' into develop
| | | | * Added the "nofail" flag to the scaladoc ant taskVlad Ureche2012-02-061-5/+22
| | | |/ | | |/| | | | | | | | | | | | | To use it, we need to update starr and then add nofail="yes" to the build.xml scaladoc tasks.
| | | * Assorted fixesEugene Burmako2012-02-068-62/+85
| | |/ | | | | | | | | | | | | Multiple fixes that have been accumulated during my investigations of 5273. Too heterogeneous to describe here, too minor to split into changesets.
| | * Revert "Added a rootdoc page for the compiler API scaladoc"Paul Phillips2012-02-053-7/+30
| | | | | | | | | | | | This reverts commit e34098b7f6e37420198fa5c7c2820d0443b46cc4.
| | * Revert "Scaladoc @usecase annotation overriding / SI-5287"Paul Phillips2012-02-051-24/+2
| | | | | | | | | | | | This reverts commit 7946ac410ad74894cd0eb6dfd29447f173911b99.
| | * Refining the reflection api.Paul Phillips2012-02-0515-45/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the pursuit of simplicity and consistency. - Method names like getType, getClass, and getValue are far too ambiguous, both internally and especially with java reflection names. Methods which accept or return scala symbols should not refer to them as "classes" in the reflection library. (We can live with the FooClass convention for naming the well-known symbols, it's names like "getClass" and "classToType" which are needlessly conflationary.) - Meaningless names like "subst" have to be expanded. - We should hew closely to the terms which are used by scala programmers wherever possible, thus using "thisType" to mean "C.this" can only beget confusion, given that "thisType" doesn't mean "this.type" but what is normally called the "self type." - It's either "enclosing" or "encl", not both, and similar consistency issues. - Eliminated getAnnotations. - Removed what I could get away with from the API; would like to push those which are presently justified as being "required for LiftCode" out of the core. - Changed a number of AnyRefs to Any both on general principles and because before long it may actually matter. - There are !!!s scattered all over this commit, mostly where I think the name could be better. - I think we should standardize on method names like "vmSignature, vmClass" etc. when we are talking about jvm (and ostensibly other vm) things. There are a bunch more places to make this distinction clear (e.g. Symbol's javaBinaryName, etc.) - There is a lot more I want to do on this and I don't know where the time will come from to do it. Review by @odersky, @scalamacros.
| | * Reimplemented Modifer.Paul Phillips2012-02-054-21/+11
| | | | | | | | | | | | | | | Couldn't live with a scala.Enumeration being a permanent fixture in the reflection library. Rolled it by hand.
| | *-----. Merge remote-tracking branches 'VladUreche/feature/compiler-rootdoc', ↵Paul Phillips2012-02-055-34/+33
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'scalamacros/pullrequest/5334', 'scalamacros/pullrequest/5272' and 'VladUreche/issue/5287-cleanup' into develop
| | | | | | * Scaladoc @usecase annotation overriding / SI-5287Vlad Ureche2012-02-051-2/+24
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From now on, the usecases inherit the comments from their parents, such as the explanation and the annotations: @param, @tparam, @return, etc. An example of usecase comment inheritance is: /** * The test function tests the parameter param for ... * * @param theParam the implicit parameter to be tested for ... * @return the result of the test * * * * @usecase def test(): Bool * * The test function tests the parameter taken implicitly from scope. * Example: `test()` * * @return the result of the test for the current scope * * * * @usecase def test(theParam: SomeType): Bool * * This takes the explicit value passed. * Example: `test(3)` * * @param theParam the explicit parameter to be tested for ... */ def test(implicit theParam: SomeType): Bool Notice both usecases override the explanation with their own examples. The first usecase also overrides the "@return" annotation while the 2nd usecase overrides the "@param theParam" annotation. If they didn't override the explanations and annotations, they would inherit the values from the actual implementation, def test(implicit ...) This will be followed by @inheritdoc, which enables more fine-grained control over comment inheritance. The full explanation of using comment inheritance and @inheritdoc and their interaction with variables is given at https://wiki.scala-lang.org/display/SW/Tags+and+Annotations in the "Comment inheritance" and "Inheritance Example" sections.
| | | | | * Fixes https://issues.scala-lang.org/browse/SI-5272Eugene Burmako2012-02-051-2/+2
| | | | |/
| | | * / Added a rootdoc page for the compiler API scaladocVlad Ureche2012-02-053-30/+7
| | |/ / | |/| |
| | * | Merge remote-tracking branch 'szabolcsberecz/small-cleanup' into developPaul Phillips2012-02-052-3/+2
| | |\ \ | | | |/ | | |/|
| | | * one less TODO and null checkSzabolcs Berecz2012-02-052-3/+2
| | |/ | |/|
| | * Replaced LiftCode with a function in MacroContextEugene Burmako2012-02-0512-214/+140
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Major cleanup of reification: * LiftCode phase has been removed * Code has been deprecated and will be removed as we roll a new starr * Logic related to type-directed lifting has been purged scala.reflect.macro.Context#reify now provides the same services as LiftCode provided (except that it returns Tree, not Code). For testing purposes, I've retained the oh-so-convenient automagic lift. test/files/codelib/code.jar now hosts Code.lift reimplemented in a macro, so that the tests can continue working as if nothing has happened.
* | Merge remote-tracking branch 'odersky/topic/inline' into inline-remergePaul Phillips2012-02-067-18/+33
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/internal/Definitions.scala src/compiler/scala/tools/nsc/typechecker/Namers.scala src/library/scala/AnyVal.scala test/files/run/primitive-sigs-2.check test/files/run/t4172.check test/files/scalap/abstractClass/result.test test/files/scalap/abstractMethod/result.test test/files/scalap/caseClass/result.test test/files/scalap/cbnParam/result.test test/files/scalap/classPrivate/result.test test/files/scalap/classWithExistential/result.test test/files/scalap/classWithSelfAnnotation/result.test test/files/scalap/covariantParam/result.test test/files/scalap/implicitParam/result.test test/files/scalap/paramClauses/result.test test/files/scalap/paramNames/result.test test/files/scalap/sequenceParam/result.test test/files/scalap/simpleClass/result.test test/files/scalap/traitObject/result.test test/files/scalap/typeAnnotations/result.test test/files/scalap/valAndVar/result.test test/files/scalap/wildcardType/result.test
| * | Added hook in erasure.Martin Odersky2012-02-061-0/+3
| | |
| * | Removing AnyVal as a source class. Removing automatic addition of ↵Martin Odersky2012-02-066-33/+27
| | | | | | | | | | | | ScalaObject. Undoing wrong fix in ExtensionMethods.
| * | Definitions are now initialized in reflection (was missing before).Martin Odersky2012-02-062-0/+7
| | |
| * | Different treatment of Null <:< T, to allow for Any-extending traits. ↵Martin Odersky2012-02-061-83/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the change, val x: List[String] with Ordered[String] = null would be illegal. The change is reflected in my local copy of the spec. Where it now says in the section of conformance: \item For every non-bottom class type $T$, $\mbox{\code{scala.Null}} \conforms T$, unless $T \conforms \mbox{\code{scala.AnyVal}}$ or $T \conforms \mbox{\code{scala.NotNull}}$.
| * | Fix in Definitions that now enables bootstrap without AnyVal.scala present. ↵Martin Odersky2012-02-031-1/+1
| | | | | | | | | | | | This should be a new starr.