aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
Commit message (Collapse)AuthorAgeFilesLines
* Generalize test to function classesMartin Odersky2015-11-161-0/+9
| | | | | | The previous test was too struct, missed cases where some arguments of the function were unbound. i583a.scala contains a test case.
* Merge pull request #927 from dotty-staging/stdlib-boundsodersky2015-11-092-39/+8
|\ | | | | Drop checking that lower bound is a subtype of upper bound.
| * Check bounds of inferred typevars in PostTyper.Martin Odersky2015-11-051-0/+8
| |
| * Drop test that lower bound must be a subtype of upper bound.Martin Odersky2015-11-051-39/+0
| | | | | | | | | | | | As discussed in #780 and #525, the test is not needed. This makes t1279a compile, which got moved now to pos. Fixes #780 and #915. It also makes scala.List compile. Review by @smarter.
* | Handle variance unsoundness in scalacMartin Odersky2015-11-051-0/+26
|/ | | | | | | | | | | | | | | | | The included test pos-special/variances-constr.scala demonstrates an unsoundness in the variance checking of scalac. Scalac excludes symbols owned by constructors from the checking. This is unsound, as can be demonstrated by compiling the test and observing output of the program run: Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at Test$.main(variances-constr.scala:17) at Test.main(variances-constr.scala) Dotty allows this code only under -language:Scala2 and issues a migration warning.
* Merge pull request #900 from dotty-staging/fix-#871odersky2015-11-051-0/+5
|\ | | | | Deal gracefully with missing return types of abstract menthods.
| * Deal gracefully with missing return types of abstract menthods.Martin Odersky2015-11-011-0/+5
| | | | | | | | | | | | | | 1) Better error message: "missing return type" instead of `=' expected. 2) Allow them under language:Scala2 Fixes #871
* | Merge pull request #860 from dotty-staging/change-allow-ex-in-hkDmitry Petrashko2015-11-022-15/+4
|\ \ | |/ |/| Change allow ex in hk
| * Represent references to Scala2 inner classes as WithFixedSym typesMartin Odersky2015-10-251-4/+4
| | | | | | | | | | | | | | Reason: An inner Scala2 class might be shadowed by a same-named class in a subtype. In Dotty this is disallowed butin Scala 2 it is possible. For instance, math.Numeric and math.Ordering both have an inner class "Ops". Normal TypeRef types could not select the shadowed class in Ordering is the prefix is of type Numeric.
| * Allow existential types in hk typesMartin Odersky2015-10-241-11/+0
| |
* | Merge pull request #886 from dotty-staging/fix-#884Guillaume Martres2015-10-302-6/+6
|\ \ | | | | | | Fix #884 - misdiagnosed ambiguous definition.
| * | Fix #884 - misdiagnosed ambiguous definition.Martin Odersky2015-10-292-6/+6
| |/ | | | | | | | | Universal equality strikes again. Caused a bug in isDefinedInCurrentUnit.
* / Don't count suppressed errorsMartin Odersky2015-10-261-0/+9
|/ | | | If an error message was supressed to count it in the total.
* Better handling of merge errorsMartin Odersky2015-10-221-0/+7
| | | | | | | | Instead of picking one at random, throw a MergeError which might be caught later in mergeDenot. MergeDenot has enough info to pick a simulate Scala2 linarization if the prefix comes from Scala2, or it rethrows the exception so that it becomes a type error.
* Add well-formedness checking for created symbolsMartin Odersky2015-10-223-0/+74
| | | | Enforces various restrictions of definitions.
* Fix tests to survive wellformedness checksMartin Odersky2015-10-223-3/+3
|
* Merge pull request #821 from dotty-staging/fix-check-simple-kindedDmitry Petrashko2015-10-201-1/+7
|\ | | | | Check that some types are not higher-kinded.
| * Check that some types are not higher-kinded.Martin Odersky2015-10-071-1/+7
| | | | | | | | Invalidates #813. Review by @darkdimius.
* | Merge pull request #799 from dotty-staging/change-inferenceodersky2015-10-071-0/+7
|\ \ | |/ |/| Change inference
| * Added neg testMartin Odersky2015-09-181-0/+7
| | | | | | | | (scalac and dotty both produce an error here)
* | Move test to posMartin Odersky2015-09-291-7/+0
| | | | | | | | | | A test that checked for errors on overloading now succeeds with the new rules.
* | Matching denotations should take infos into accountMartin Odersky2015-09-291-2/+2
| | | | | | | | | | | | | | | | Whenchecking whether two denotations match it is not enough to look at the signatures. The signatures might match (on the parameters) but the actual parametre types might be different. The change always tests infos after signatures, effectively turning the signature test into a pre-filter.
* | Disallow wildcard arguments to higher-kinded types...Martin Odersky2015-09-181-0/+11
|/ | | | ...unless the HK type can be eta-reduced to a class type.
* Merge pull request #767 from dotty-staging/fix-#756-super-accessorsDmitry Petrashko2015-08-281-0/+8
|\ | | | | Fix #756 super accessors
| * Add missing negative test.Martin Odersky2015-08-211-0/+8
| |
* | Make it a syntactic criterion whether a literal is a legal typeMartin Odersky2015-08-241-0/+2
| | | | | | | | | | Introduce a new non-terminal "SimpleLiteral". Only SimpleLiterals can be types.
* | Better error message for Null and 'sym singleton types.Martin Odersky2015-08-231-0/+4
| | | | | | | | | | | | Null and 'sym are not legal as singleton types because the underlying values are not stable. They are rejected now outright instead of issuing a cryptic "X is not stable" error message.
* | Update neg testMartin Odersky2015-08-231-1/+0
| | | | | | | | It's decided that constant types and purity are independent.
* | Tests of functionality.Martin Odersky2015-08-231-0/+6
|/ | | | | | As the comment in pos/singletons.scala says, we currently test only constant propagation during typer. We should also have a test that literalize produces the literals in the right places.
* Merge pull request #719 from dotty-staging/fix/doubledefsDmitry Petrashko2015-07-201-0/+6
|\ | | | | Avoid crashes on double definitions
| * Add test caseMartin Odersky2015-07-091-0/+6
| |
* | 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
* | 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 #695 from dotty-staging/fix/source-positionsDmitry Petrashko2015-07-021-0/+4
|\ | | | | Avoid crasher when first token of a program is in error
| * 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-021-0/+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.
* Implement trait parametersMartin Odersky2015-06-191-0/+12
| | | | | | 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
|
* 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).
* New miniphase: ExpandSAMsMartin Odersky2015-05-021-7/+0
| | | | The phase replaces SAM closures with anonymous classes when necessary.
* Fix #492. Traits that require an outer pointer are not SAMs.Dmitry Petrashko2015-04-231-0/+7
|
* Added phase to check `New` nodes for instantiability.Martin Odersky2015-04-131-0/+38
| | | | | | - Abstract classes cannot be instantiated (exceptions: parent news and Java annotations) - Instantiateed class must conform to its self type.
* Self type inheritance checkMartin Odersky2015-04-131-0/+28
| | | | Check that the self type of a class conforms to the self types of its parent classes.
* Add spaces around + in tests.Dmitry Petrashko2015-04-092-3/+3
|
* Remove trailing spaces in Dotty tests.Dmitry Petrashko2015-04-094-13/+13
|