aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #714 from smarter/add/vc-inline-before-erasureDmitry Petrashko2015-07-151-0/+37
|\ \ \ | | | | | | | | Move the inlining of value class methods before Erasure
| * | | Move the inlining of value class methods before ErasureGuillaume Martres2015-07-071-0/+37
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VCInline is split into two phases: - VCInlineMethods (before Erasure) replaces value class method calls by calls to extension methods - VCElideAllocations (after Erasure) handles == and optimizing the unboxing of a boxed value class, as VCInline did before. This should not affect anything currently, but in the future we will have phases before Erasure that mangle names (like TypeSpecializer, see #630), being able to put these phases after VCInlineMethods means that VCInlineMethods does not need to know anything about how these phases mangle names, this reduces the coupling between phases. The trade-off is that VCInlineMethods needs to deal with type parameters and multiple parameter lists whereas VCInline didn't.
* | | Merge pull request #721 from smarter/fix/implicit-scope-boundsodersky2015-07-151-0/+14
|\ \ \ | | | | | | | | Don't add lower bounds of abstract types to the implicit scope
| * | | Don't add lower bounds of abstract types to the implicit scopeGuillaume Martres2015-07-111-0/+14
| |/ / | | | | | | | | | | | | | | | | | | | | | As the spec[1] says: "The parts of a type T are [...] if T is an abstract type, the parts of its upper bound;" [1]: http://www.scala-lang.org/files/archive/spec/2.11/07-implicits.html#implicit-parameters
* / / SyntheticMethods: override productPrefix for case classesGuillaume Martres2015-07-132-0/+21
|/ / | | | | | | | | The productPrefix of a case class should be the name of the class itself to match Scala 2.
* | Check that a self type T is closed.Martin Odersky2015-07-061-0/+4
| | | | | | | | | | | | | | | | What is checked: A self type T is a subtype of all selftypes of classes refernced by T. That is, a self type has to subsume all self types of its required type. Ot, otherwise said, requirements must be closed; you cannot discover new ones in following them.
* | Error instead of crash when sigName comes up with a missing reference.Martin Odersky2015-07-061-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A TypeRef can have be unresolved, either because it refers to something that's missing from the classpath or because of transitive self type references. Instead of crashing in sigName, we now report the error. Achieved by defining a new exception type, MissingType, which derives from TypeError. This catches t7933.scala, now integrated in the neg/selfreq.scala. The problem there was a reference to AbsSettings, which was not a member of StandardScalaSettings.this, but was a member of the required type of AbsSettings, which itself appeared in the required type of StandardScalaSettings. We will outlaw in the next commit such transitive required references. Also collapsed TypeError and FatalTypeError. It was a misnomer anyway. Fatal were those type errors that were caught and reported! Open: Where else we should check for unresolved NamedTypes.
* | Merge pull request #694 from dotty-staging/fix/dependent-methodsodersky2015-07-062-1/+20
|\ \ | |/ |/| Fix/dependent methods
| * Add test from pending.Martin Odersky2015-06-251-0/+0
| |
| * Sharpen prototypes of implicit methods.Martin Odersky2015-06-251-0/+15
| | | | | | | | | | | | | | Necessary to make implicit resolution of type-level peano numbers work. The current commit makes takes the inimal steps to make this happen. We could also consider sharpening using followAlias every type we constrain a result, or every time we adapt a type.
| * Handle normalization of implicit dependent methods.Martin Odersky2015-06-231-1/+5
| | | | | | | | Now handles included test if toplevel implicit is given, but not yet without.
* | Tests that objects nested in value class methods workGuillaume Martres2015-07-042-0/+17
| | | | | | | | This confirms that SI-6359 does not apply to Dotty.
* | Merge pull request #695 from dotty-staging/fix/source-positionsDmitry Petrashko2015-07-022-3/+7
|\ \ | | | | | | Avoid crasher when first token of a program is in error
| * | Updated check file.Martin Odersky2015-06-251-3/+3
| | | | | | | | | | | | Seems partest adds code to the sources so that line numbers are not the same.
| * | Update check file.Martin Odersky2015-06-251-3/+3
| | | | | | | | | | | | Line numbers were wrong in previous file.
| * | Avoid crasher when first token of a program is in errorMartin Odersky2015-06-251-0/+4
| |/ | | | | | | | | This used to give a crash in SourcePositiom, promoted by feeding its calculations with a negative offset.
* | Check value class member restrictionsMartin Odersky2015-07-022-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to SIP 15 a value class C must obey the following restrictions: C may not have secondary constructors. C may not declare fields (other than the parameter of a value class). C may not contain object definitions. C may not have initialization statements. These are enforced by this commit. We are still missing restrictions on value class paremeters. We should review what the right set of conditions is (probably we want to admit non-vals, and maybe even multiple parameters).
* | Check that value classes are staticMartin Odersky2015-07-021-0/+15
| |
* | Check final and sealed conditionsMartin Odersky2015-07-021-0/+4
| | | | | | | | | | So far no error was raised for illegal inheritance from final or sealed classes.
* | Drop Module flag from lifted symbols.Martin Odersky2015-06-262-0/+10
| | | | | | | | | | | | | | Reason: A lifted module is no longer a module (i.e. singleton object) in the scope to which it is lifted. Fixes #689.
* | Restored full testMartin Odersky2015-06-261-5/+5
| | | | | | | | Uncommented parts that were left accidentally commented out when debugging.
* | Remove check file.Martin Odersky2015-06-261-1/+0
| | | | | | | | | | The file consisted of just a deprecation warning. Not sure what was deprecated; neither dotty nor scalac find anything wrong with it.
* | Fix erasure of Thistypes.Martin Odersky2015-06-262-5/+5
| | | | | | | | | | | | | | | | | | | | Thistypes erased to the underlying class. This is wrong. When seen as part of some other type, a ThisType has to erase to the erasure of the underlying type (i.e. the erasure if the selftype of the class). unittest-collections.scala failed with a MethodNotFound error because the erasure was computed incorrectly. On the other hand, a tree with a ThisType type, should keep the type, analogous to a tree with a TermRef type.
* | Merge pull request #678 from dotty-staging/fix/#670-orphan-polyparamodersky2015-06-251-3/+3
|\ \ | |/ |/| Avoid junk produced by Constraint#replace.
| * Revert test to originalMartin Odersky2015-06-231-2/+2
| | | | | | | | Uncomment two lines that were commented out by accident.
| * Avoid junk produced by Constraint#replace.Martin Odersky2015-06-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two instances where a constraint undergoing a replace would still refer to poly params that are no longer bound after the replace. 1. In an ordering the replaced parameters was n ot removed from the bounds of the others. 2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the replaced parameter was not replaced. We now have checking in place that in globally committable typer states, TypeVars are not instantiated to PolyParams and (configurable) that constraints of such typer states are always closed. Fixes #670.
* | 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.