aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #677 from alexander-myltsev/am-579-implement_class_ofDmitry Petrashko2015-06-232-0/+6
|\ | | | | Closes #579 Implement mini-phase for classOf[T]
| * Closes #579 Implement mini-phase for classOf[T]Alexander Myltsev2015-06-222-0/+6
| |
* | Merge pull request #667 from dotty-staging/fix/#646-array-additionodersky2015-06-222-0/+0
|\ \ | | | | | | Fix/#646 array addition
| * | Do not check for ambiguous implicits in viewExistsMartin Odersky2015-06-222-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `viewExists(X, Y)` failed if there were ambiguous implicit conversions from X to Y. This is too fragile, as demonstrated by test case run/array-addition.scala. Here, the `genericArrayOps` implicit was not inserted because its result type `Array[?T]` was deemed to be incompatible with `? { +: : ? }`. It was incompatible because there were multiple implicits that added :+ to arrays of various element types. But once `genericArrayOps` gets applied, the type parameter `?T` of the array result is fixed, and the ambuity goes away. The scenario shows that we should not test for ambiguous implicits in viewExists. Such a test is fragile because it depends on the progress of type inference when the test is made. It's preferable to just test for any implicit conversion to exist and to check for ambiguities later, when the implicit conversion is actually applied. This has also the potential of speeding up implicit search in situations where `viewExists` is called often (e.g. when coupled with overloading resolution).
* | | Merge pull request #675 from dotty-staging/fix/#652-erase-constructorsodersky2015-06-228-5/+8
|\ \ \ | |/ / |/| | Fix/#652 erase constructors
| * | Re-enable sanitized printingMartin Odersky2015-06-201-1/+1
| | | | | | | | | | | | Ws disabled by accident.
| * | Avoid noise introduced by printing anonymous class numbersMartin Odersky2015-06-202-4/+6
| | | | | | | | | | | | | | | | | | We seem to have an instability where the testing framework influences what numbers anonymous classes are given. We have to deal with this, but not now. For the moment I am masking numbers from the test output.
| * | Updated check fileMartin Odersky2015-06-201-1/+1
| | | | | | | | | | | | Difference was in generated number for anonymous classes only.
| * | Map outer fields to parameters in primary constructorMartin Odersky2015-06-204-0/+0
| | | | | | | | | | | | | | | | | | Previously this was only done in secondary constructors; need to do it in primary constructor as well to avoid "reference to this before super" problems.
| * | Map proxy references in constructors to parametersMartin Odersky2015-06-202-0/+0
| | | | | | | | | | | | | | | Proxy references in constructors can't be left as fields because they can happen before the supercall.
| * | Map outer accessors to outer paramatersMartin Odersky2015-06-192-1/+2
| |/ | | | | | | | | Map references to outer accessors in secondary constructors to outer parameters. This was the second source of "reference to this before super call" errors.
* | Merge pull request #668 from lampepfl/fix/#650-self-typesodersky2015-06-223-0/+5
|\ \ | | | | | | Fix checking whether types are instantiable.
| * | Fix checking whether types are instantiable.Martin Odersky2015-06-193-0/+5
| | | | | | | | | | | | | | | The logic for checking aginst the self type was wrong, as demonstrated by pos/checkInstantiable.scala.
* | | Merge pull request #674 from dotty-staging/fix/#655-eta-expansionodersky2015-06-212-0/+0
|\ \ \ | |_|/ |/| | Fix/#655 eta expansion
| * | Fix problem in eta expansion.Martin Odersky2015-06-192-0/+0
| | | | | | | | | | | | Failure to do a widen caused by-name parameters to go undetected.
* | | Merge pull request #669 from dotty-staging/fix-patmat-seqodersky2015-06-194-0/+0
|\ \ \ | | | | | | | | Fix sequence matching.
| * | | Enable t5629b.Dmitry Petrashko2015-06-192-0/+0
| | | | | | | | | | | | | | | | Was also fixed in this PR.
| * | | Fix wrong test in PatMat.Dmitry Petrashko2015-06-192-0/+0
| | | | | | | | | | | | | | | | | | | | Call drop method directly if class derives from sequence. I do not understand how callRuntime works in scalac. Calling this method requires implicit search.
* | | | Merge pull request #671 from dotty-staging/fix/#659-lambdalift-proxiesodersky2015-06-191-0/+26
|\| | | | |/ / |/| | Fix/#659 lambdalift proxies
| * | Add initializers for lambdalift proxy fieldsMartin Odersky2015-06-191-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | If an inner class has proxy fields, we missed so far the assignment sfrom the proxy parameters in the primary constructor of the class to the proxy fields. Test case tries several variations of this.
| * | Fix problem with explicit outer accessorsMartin Odersky2015-06-191-0/+12
| | | | | | | | | | | | Even if an explicit outer accessor was a method, it got a TermRef as type.
* | | Add test that succeedsMartin Odersky2015-06-191-0/+8
| | |
* | | Add failing test for #670.Martin Odersky2015-06-191-0/+26
| | |
* | | Take expected result type into account more often for overloading resolutionMartin Odersky2015-06-191-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the expected result type of a FunProto type was ignored and taken into account only in case of ambiguities. arrayclone-new.scala shows that this is not enough. In a case like val x: Array[Byte] = Array(1, 2) we typed 1, 2 to be Int, so overloading resulution would give the Array.apply of type (Int, Int*)Array[Int]. But that's a dead end, since Array[Int] is not a subtype of Array[Byte]. This commit proposes the following modified rule for overloading resulution: A method alternative is applicable if ... (as before), and if its result type is copmpatible with the expected type of the method application. The commit does not pre-select alternatives based on comparing with the expected result type. I tried that but it slowed down typechecking by a factor of at least 4. Instead, we proceed as usual, ignoring the result type except in case of ambiguities, but check whether the result of overloading resolution has a compatible result type. If that's not the case, we filter all alternatives for result type compatibility and try again.
* | More explicit test of trait parameter initialization orderMartin Odersky2015-06-191-0/+30
| | | | | | | | As suggested by @retronym
* | Drop parameter accessor flag in traitsMartin Odersky2015-06-191-0/+6
| | | | | | | | | | Parameter accessors in traits have the ParamAccessor flag removed in the Mixin transformSym method.
* | Extend test to verify initialization orderMartin Odersky2015-06-191-6/+13
| | | | | | | | Verify that the initilialization order described in #640 is correctly implemented.
* | Convert pos test to be a run test.Martin Odersky2015-06-192-12/+19
| |
* | Implement trait parametersMartin Odersky2015-06-192-0/+24
| | | | | | | | | | | | Add necessary logic to Mixin. Also add tests that all parameterized traits are called with parameters set.
* | Implement checking for illegal parent trait constructor calls.Martin Odersky2015-06-191-0/+16
| | | | | | | | | | A parent trait may not be parameterized (as in T()) if the calling class does not directly implement that trait.
* | Add missing testMartin Odersky2015-06-191-0/+38
| |
* | Merge pull request #663 from dotty-staging/fix/#643-scala2-noinitsDmitry Petrashko2015-06-192-0/+0
|\ \ | | | | | | Fix #643 - Scala2 unpickling now sets NoInits flag for interfaces.
| * | Avoid spurious StaleSymbol error in <refinement> membersMartin Odersky2015-06-162-0/+0
| |/ | | | | | | | | | | | | Refinement classes and their members could give spurious stale symbol errors if the symbol is loaded in a different run than the classfile containing it. The problem is that refinement classes do not form part of the scope of their owners. The fix assumes that refinement classes are always "stillValid".
* | Merge pull request #599 from dotty-staging/add/existential-skolemizationodersky2015-06-193-7/+47
|\ \ | | | | | | Tighten comparison of skolem types
| * | Deskolemize types inferred for vals and defsMartin Odersky2015-06-061-0/+20
| | | | | | | | | | | | | | | | | | | | | We want to establish the invariant (optionally checked by assertNoSkolems) that symbols do not contain skolemized types as their info. This avoids unsoundness situations where a skolem gets exported as part if the result type of a method, so different instantiations look like their are the same instance.
| * | Skolemize unstable prefixes in asSeenFromMartin Odersky2015-06-061-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skolemize unstable prefixes in asSeenFrom provided - the prefix appears at least once in non-variant or contra-variant position - we are in phase typer. After typer, we have already established soundness, so there's no need to do skolemization again. We can simply do the (otherwise unsound) substitution from this-type to prefix.
| * | Tighten isStable predicateMartin Odersky2015-06-061-7/+0
| | | | | | | | | | | | | | | A term ref is stable only if its prefix is also stable. At the same time, we drop stability requirements where they no longer make sense (e.g. in isLegalPrefix).
* | | Merge pull request #664 from dotty-staging/more-testsodersky2015-06-181103-42/+20
|\ \ \ | |_|/ |/| | Enable tests that pass, move macro tests to disabled.
| * | Move tests that have " macro" or "reify" to disabled.Dmitry Petrashko2015-06-151020-0/+0
| | |
| * | Update origins.check with origins that match dotty.Dmitry Petrashko2015-06-151-3/+3
| | |
| * | Remove warnings that dotty doesn't emit from check files.Dmitry Petrashko2015-06-156-22/+0
| | |
| * | Enable tests that succeed.Dmitry Petrashko2015-06-1578-0/+0
| | |
* | | Revert changes in testMartin Odersky2015-06-151-2/+1
| | | | | | | | | | | | Changes were made by accident.
* | | Fix #651 Generalize criterion for isOpAssignMartin Odersky2015-06-152-1/+2
| | | | | | | | | | | | | | | Methods like + can have multiple parameters. In that case += also takes multiple parameters.
* | | Merge pull request #635 from dotty-staging/fix/private-scala2-trait-settersDmitry Petrashko2015-06-122-4/+10
|\| | | | | | | | Some fixes around mixin and memoization
| * | Copy annotations from trait members to their implementationsMartin Odersky2015-06-081-1/+7
| | | | | | | | | | | | Implementations inherit all annotations on the implemented trait methods.
| * | Fix to trait setter generationMartin Odersky2015-06-081-3/+3
| |/ | | | | | | | | The logic to add trait setters to Scala 2 traits was wrong. This led to AbstractMethodErrors in the formerly commented out part of scala-trait.scala.
* | Fix mergeDenot one more time.Martin Odersky2015-06-072-0/+0
| | | | | | | | | | | | | | | | | | | | It's easy to get this wrong. What happened was that when computing deferred members of a class a deferred member was preferred over a concrete one because the types did not match. Thsi should not happen. We now change the scheme to always prefer concrete over abstract, and subclass-owned over superclass-owned. But we pick a denotation only if the overrides relationship on types coincides with the preference on symbols.
* | Bring back tests from disabled.Martin Odersky2015-06-073-0/+0
| | | | | | | | The tests in this commit pos were verified to work again.
* | Fix refs to inner objectsMartin Odersky2015-06-071-1/+3
|/ | | | | | | | A reference to an object from anywhere in its module class can be established by the This of the module class. The previous behavior always referenced the object as a term ref which might cause a reference to the outer This which might not be available (since this is not tracked by ExplicitOuter). Brings t3174.scala back from disabled.