summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* New test case for SI-6337Martin Odersky2012-09-201-0/+16
| | | | | This test case shows that the variant in the comment of SI-6337 now compiles also.
* Value classes: eliminated half-boxingMartin Odersky2012-09-204-4/+36
| | | | | | | We now apply erasure of value classes everywhere. previously, erasure was disabled in the value class itself. This led to irregegularities and bugs. See test run/valueclasses-pavlov.scala for something that led to a ClassCastException before.
* Fixes SI-6260Martin Odersky2012-09-202-0/+13
| | | | | | | | Guards against bridge methods that clash with other methods. Two tests: The neg test is the original ticket. The run test tweaks things slightly so that the generated bridge method does not clash, and tests that the necessary unboxings are indeed performed at runtime.
* Merge pull request #1331 from scalamacros/ticket/5943Grzegorz Kossakowski2012-09-204-0/+20
|\ | | | | SI-5943 toolboxes now autoimport Predef and scala
| * SI-5943 toolboxes now autoimport Predef and scalaEugene Burmako2012-09-204-0/+20
| | | | | | | | | | | | | | | | | | | | Previously tb.typeCheck used default typer, which builds upon NoContext. Changing the context to analyzer.rootContext(NoCompilationUnit, EmptyTree) fixed the missing imports problem. Unfortunately this doesn't help in cases like "math.sqrt(4.0)" because of https://issues.scala-lang.org/browse/SI-6393. But anyways I'm adding this test case to pending.
* | Merge pull request #1338 from scalamacros/ticket/5418Grzegorz Kossakowski2012-09-204-0/+17
|\ \ | | | | | | existentially typed macro expansions now work fine
| * | test case closes SI-5418Eugene Burmako2012-09-182-0/+13
| | | | | | | | | | | | | | | | | | Now, when the existential reification bug is fixed, I've been able to take a look at SI-5418, and, apparently, the problem with importers has fixed itself during these 9 months of the bug being active.
| * | existentially typed expansions now work fineEugene Burmako2012-09-182-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one tries to compile the following code with the parent of this commit: ru.reify(new Object().getClass) then the following error will occur: Test.scala:2: error: type mismatch; found : $u.Expr[Class[_ <: Object]] required: reflect.runtime.universe.Expr[Class[?0(in value <local Test>)]] where type ?0(in value <local Test>) <: Object ru.reify(new Object().getClass) ^ This happens because macro expansions are always typechecked against the return type of their macro definitions instantiated in the context of expandee. In this case the expected type contains skolems which are incompatible with wildcards in the type of the expansion. I tried all the incantations I could think of - without any success. Luckily I met Martin who pointed me at the same problem solved in adapt (see the diff w.r.t Typers.scala).
* | Merge pull request #1358 from scalamacros/ticket/6392Grzegorz Kossakowski2012-09-204-0/+20
|\ \ | | | | | | SI-6392 wraps non-terms before typecheck/eval
| * | SI-6392 wraps non-terms before typecheck/evalEugene Burmako2012-09-194-0/+20
| | | | | | | | | | | | | | | Wrap non-term arguments of typecheck and eval, so that toolboxes can work with full-fledged files (except for package declarations).
* | | SI-6363 removes scala.reflect.baseEugene Burmako2012-09-1913-102/+100
| | | | | | | | | | | | | | | As the experience has shown, there's no need for a separate layer of reflection in scala-library.jar. Therefore I'm putting an end to it.
* | | fixes NameTypes in base namesEugene Burmako2012-09-194-0/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | NameType is introduced in base.StandardNames#NamesBase to abstract away the difference between term names and type names in order to encode common names such as EMPTY or WILDCARD. Flavor-specific name repositories, such as TermNames and TypeNames are supposed to override NameType fixing it to correspondingly TermName or TypeName. Unfortunately I completely overlooked this and as a result some standard names were typed with insufficient precision, e.g. This(tpnme.EMPTY) didn't work.
* | Merge pull request #1327 from scalamacros/ticket/6287Grzegorz Kossakowski2012-09-194-0/+49
|\ \ | | | | | | SI-6287 fixes synthetic symbol clashes in toolbox
| * | test case closes SI-5770Eugene Burmako2012-09-182-0/+35
| | |
| * | SI-6287 fixes synthetic symbol clashes in toolboxEugene Burmako2012-09-172-0/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently synthetic classes like $anonfun$1 have two properties: 1) Their names are generated using a counter unique to a compilation unit 2) After flatten they levitate to the nearest enclosing package As a result if we use an empty package to wrap toolbox codegen, then this package will soon be overflown by $anonfun$1 symbols, because: 1) New codegen session = new compilation unit = new counter which starts at 0 2) New codegen session = new anon funs that end up as children of empty package Creating a freshly named package for each codegen session fixed the problem. Now anonfuns from different sessions end up with different parents.
* | Merge pull request #1324 from scalamacros/ticket/6374Eugene Burmako2012-09-185-42/+16
|\ \ | | | | | | Scala reflection now supports Java CRTP
| * | refactors java reflection testsEugene Burmako2012-09-176-88/+15
| | | | | | | | | | | | All javac-produced artifacts are now placed into test/files/lib
| * | SI-6374 Reflection now works for anns with enum fieldsEugene Burmako2012-09-172-2/+2
| | | | | | | | | | | | | | | Enum members are static and, therefore, they need to be looked up in classSymbol(<enum>).companionModule, rather than in classSymbol(<enum>).
| * | Reflection no longer produces faux existentialsEugene Burmako2012-09-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Because of using plain ExistentialType factory of a case class typeToScala sometimes returned existentials with empty quantifieds. Changing ExistentialType to newExistentialType, which simply returns the underlying types if params are empty, fixed the problem.
| * | SI-6374 Scala reflection now supports Java CRTPEugene Burmako2012-09-173-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translation of Java types to Scala types has previously been existentionalizing raw types of ParameterizedType arguments. As shown in https://issues.scala-lang.org/browse/SI-6374 this leads to cyclic reference errors. If you wonder about the mechanism of the error, take a look at the comments to the aforementioned issue - there's a detailed explanation. However calling rawToExistential is completely unnecessary, because existential parameters of the results are immediately discarded, and only prefix and symbol are used later on (which means that existential extrapolation performed by rawToExistential also doesn't after the result). Finding out this was tough, but the rest was a piece of cake. Getting rid of the call to rawToExistential when translating ParameterizedType fixed the problem.
* | | Merge pull request #1298 from pavelpavlov/SI-5767Josh Suereth2012-09-186-1/+17
|\ \ \ | | | | | | | | SI-5767 fix + protecting public FlatHashMap API
| * | | pull request feedbackPavel Pavlov2012-09-186-1/+17
| | | |
* | | | Merge pull request #1340 from gkossakowski/revert-static-annotationGrzegorz Kossakowski2012-09-186-333/+0
|\ \ \ \ | | | | | | | | | | Revert `@static` annotation
| * | | | Revert "Implement @static annotation on singleton object fields."Grzegorz Kossakowski2012-09-171-205/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 892ee3df93a10ffe24fb11b37ad7c3a9cb93d5de with exception of keeping `@static` annotation in the library so we can deploy a new starr that does not depend on it before removing it completely. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala src/compiler/scala/tools/nsc/transform/CleanUp.scala
| * | | | Revert "WIP add private/lazy checks and a few tests."Grzegorz Kossakowski2012-09-171-38/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 227239018b38ab7218ee6b30493c9c8e1836c8c9.
| * | | | Revert "Fixes SI-6189."Grzegorz Kossakowski2012-09-172-54/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5a8dfad583b825158cf0abdae5d73a4a7f8cd997. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
| * | | | Revert "Fixes SI-6236."Grzegorz Kossakowski2012-09-174-32/+2
| | | | | | | | | | | | | | | | | | | | This reverts commit faa114e2fb6003031efa2cdd56a32a3c44aa71fb.
| * | | | Revert "Fix SI-4581."Grzegorz Kossakowski2012-09-171-9/+3
| | |_|/ | |/| | | | | | | | | | This reverts commit 373f22a2022519ab894c1ea77460e6460d7c2ee4.
* / | | SI-5942 toolboxes now reset front endsEugene Burmako2012-09-182-0/+10
|/ / / | | | | | | | | | | | | FrontEnd => Reporter proxy now correctly redirects flush and reset back to the underlying front end.
* | | Merge pull request #1321 from namin/apply-dynamic-sugarGrzegorz Kossakowski2012-09-174-1/+29
|\ \ \ | | | | | | | | Fixed SI-6353: applyDynamic with sugared applications
| * | | Fixed SI-6353: applyDynamic with sugared applicationsamin2012-09-174-1/+29
| | |/ | |/| | | | | | | | | | | | | | | | - Accept sugared applications such as x(1) if x implements Dynamic, so x(1) gets re-written to x.apply(1). - When picking a dynamic rewrite for x.apply(1), favor applyDynamic instead of the default selectDynamic.
* | | Merge pull request #1320 from scalamacros/topic/is-implicitPaul Phillips2012-09-172-0/+17
|\ \ \ | | | | | | | | moves isImplicit from TermSymbol to Symbol
| * | | moves isImplicit from TermSymbol to SymbolEugene Burmako2012-09-162-0/+17
| | | | | | | | | | | | | | | | Because classes can also be implicit.
* | | | Revert "Added constant empty array to the companion objects."Paul Phillips2012-09-161-3/+3
| |/ / |/| | | | | | | | This reverts most of commit 9d84e89d2 .
* | | Merge pull request #1310 from scalamacros/ticket/6329Eugene Burmako2012-09-168-0/+59
|\ \ \ | |/ / |/| | test suite for SI-6329
| * | test suite for SI-6329Eugene Burmako2012-09-068-0/+59
| | |
* | | SI-6356 reflection now supports Java annotationsEugene Burmako2012-09-163-0/+43
| | | | | | | | | | | | | | | Except for one thingie: java enums are currently not understood by Scala reflection, hence they aren't yet supported in annotations.
* | | Merge pull request #1302 from scalamacros/topic/reflectionEugene Burmako2012-09-1460-62/+62
|\ \ \ | | | | | | | | cleaning up reflection
| * | | SI-6342 cleans up toolbox APIEugene Burmako2012-09-1560-62/+62
| | | | | | | | | | | | | | | | | | | | | | | | 1) parseExpr => parse 2) runExpr => eval 3) Introduces compile(Tree): () => Any, since it has frequent uses
* | | | Merge pull request #1299 from namin/si-6245Paul Phillips2012-09-146-54/+0
|\ \ \ \ | | | | | | | | | | Fix for SI-6245 with workaround for SI-2296.
| * | | | Fix for SI-6245 with workaround for SI-2296.amin2012-09-136-54/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | protected/super accessor issue: Don't subvert the creation of the standard protected accessor with the java interop accessor. For SI-2296, the compiler emits an error instead of causing an illegal access error at runtime.
* | | | | Added constant empty array to the companion objects.Paul Phillips2012-09-142-0/+11
| |/ / / |/| | | | | | | | | | | | | | | | | | | Because there are lots of times when you just need an array and shouldn't have to allocate one every time or pick a random spot to cache yet another empty array.
* | | | Merge pull request #1271 from retronym/ticket/6331Josh Suereth2012-09-144-0/+144
|\ \ \ \ | | | | | | | | | | SI-6331 deconst If type / refine equality of floating point Constant types.
| * | | | Test for consistency of Constant#{equals, hashCode}.Jason Zaugg2012-09-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the examples I've constructed, they are consistent, but I put this down to good luck, rather than good management. The next commit will address this.
| * | | | Refine equality of Constant types over floating point values.Jason Zaugg2012-09-082-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constant types for 0d and -0d should not be equal. This is implemented by checking equality of the result of doubleToRawLongBits / floatToRawIntBits, which also correctly considers two NaNs of the same flavour to be equal. Followup to SI-6331.
| * | | | SI-6331 Avoid typing an If tree with a constant type.Jason Zaugg2012-09-082-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fast path in typedIf added in 8552740b avoided lubbing the if/else branch types if they are identical, but this fails to deconst the type. This could lead to the entire if expression being replaced by a constant. Also introduces a new tool in partest for nicer checkfiles. // in Test.scala trace(if (t) -0d else 0d) // in Test.check trace> if (Test.this.t) -0.0 else 0.0 res: Double = -0.0
* | | | | Merge pull request #1281 from jsuereth/fix/SI-4813Josh Suereth2012-09-141-0/+37
|\ \ \ \ \ | | | | | | | | | | | | Fix SI-4813 - Clone doesn't work on LinkedList.
| * | | | | Fix SI-4813 - Clone doesn't work on LinkedList.Josh Suereth2012-09-141-0/+37
| | |/ / / | |/| | | | | | | | | | | | | | | | | | * Added extensive test for clone across all standard mutable collections * Fixed clone implementations when needed so they work.
* | | | | SI-6310 AbsTypeTag => WeakTypeTagEugene Burmako2012-09-1443-110/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new name for AbsTypeTag was a matter of a lengthy discussion: http://groups.google.com/group/scala-internals/browse_thread/thread/fb2007e61b505c4d I couldn't decide until having fixed SI-6323 today, which is about trying to reflect against a local class using typeOf. The problem with local classes is that they aren't pickled, so their metadata isn't preserved between Scala compilation runs. Sure, we can restore some of that metadata with Java reflection, but you get the idea. Before today typeOf of a local class created a free type, a synthetic symbol, with a bunch of synthetic children that remember the metadata, effectively creating a mini symbol table. That might be useful at time, but the problem is that this free type cannot be reflected, because the global symbol table of Scala reflection doesn't know about its mini symbol table. And then it struck me. It's not the presence of abs types (type parameters and abs type members) that differentiates arbitrary type tags from good type tags. It's the presence of types that don't map well on the runtime world - ones that can't be used to instantiate values, ones that can't be reflected. So we just need a name for these types. Phantom types are compile-time only concept, whereas our types can have partial correspondence with the runtime. "Weak types" sound more or less okish, so let's try them out.
* | | | | SI-6323 outlaws free types from TypeTagEugene Burmako2012-09-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Free types are no longer acceptable in normal type tags. Like type parameters or abstract type members they don't map on any real type, therefore I think this is a justified change. The main reason for doing is this is to prohibit people from using `typeOf` on local classes. Sure, the guard introduced in the previous commit will raise runtime errors about that, but this commit provides static checking. Those especially persistent might use `absTypeOf` and then try to play around with the weak type it returns, but that's advanced usage scenario, and I don't worry much about it. Bottom line: `typeOf` should just work. Things that work with additional effort should be explicitly marked as such.