aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Don't evaluate isInstanceOf for value classes, disable bugged testsFelix Mulder2016-05-261-27/+36
| | | | | | | | | | | | | | | | | | | | | The tests `i1059.scala` and `t3480.scala` are failing due to a bug in pattern matcher that evaluates the `x` in `List(x: _*)` incorrectly. Concerned issue: #1276
* | | Address reviewer feedbackFelix Mulder2016-05-261-10/+19
| | |
* | | Fix primitive rewritingFelix Mulder2016-05-261-1/+1
| | |
* | | Rewrite `TypeApply` to null-check on rewrite to true, add docstringsFelix Mulder2016-05-261-23/+82
| | |
* | | Add initial partial evaluation of isInstanceOf callsFelix Mulder2016-05-263-2/+92
| | |
* | | Fix doc commentMartin Odersky2016-05-231-1/+1
| | |
* | | Move eqAny to PredefMartin Odersky2016-05-234-15/+14
| | |
* | | Add Eq instances of standard types to PredefMartin Odersky2016-05-232-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | To make tests pass, this required a looser specification of `assumedCanEquals`, so that an abstract type T can be compared to arbitrary values, as long as its upper bound can be compared. E.g. T == null T == "abc"
* | | Address reviewers commentsMartin Odersky2016-05-231-5/+5
| | |
* | | Tweak of valid eqAny conditionMartin Odersky2016-05-231-39/+30
| | |
* | | Fix comments in Eq class and make it a trait.Martin Odersky2016-05-231-4/+7
| | |
* | | Make use of implicitNotFound for eqaulity errorsMartin Odersky2016-05-233-4/+6
| | | | | | | | | | | | | | | Needed a fix in string interpolation for suriviving inserted types that contain `$` characters.
* | | Safe equality for core classes:Martin Odersky2016-05-236-6/+14
| | | | | | | | | | | | | | | | | | | | | Name, Symbol, Denotation, Type. This uncovered two nonsensical comparisons, one in CollectEntryPoints, the other in DottyBackendInterface.
* | | Print diagnostics to implicits printerMartin Odersky2016-05-231-2/+2
| | |
* | | Make Eq contravariantMartin Odersky2016-05-231-0/+17
| | | | | | | | | | | | (and add it to commit set).
* | | Check equality that with == and != makes senseMartin Odersky2016-05-233-13/+46
| | | | | | | | | | | | | | | | | | This is done by checking each instance of an eqAny implicit so that it does not contain non-bottom instances of equality types as instances.
* | | Hooks to check that comparisons with == / != make senseMartin Odersky2016-05-235-46/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, check that pattern matching against idents/selects/literals makes sense. The hooks perform an implicit search for an instance of `Eq[L, R]`, where `L`, `R` are the argument types. So far this always succeeeds because Eq.eqAny matches all such types. A separate commit will check the returned search term for validity.
* | | Fixed error in commentMartin Odersky2016-05-231-2/+2
| | |
* | | Downwards comparisons for implicit search and overloading resolutionMartin Odersky2016-05-233-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | Compare selected contravariant arguments as if they were covariant. Which ones is explained in the doc comment for method `isAsSpecificValueType` in Applications.scala. This has the same motivation than what @paulp proposed around 2012. The solution is a bit different from the one proposed then because it only affects top-level parameters.
* | | Ignore LazyRefs in Tasty pickling comparisonsMartin Odersky2016-05-231-0/+2
| | | | | | | | | | | | This came up when tasty-checking Eq.scala.
* | | Fix caching problem when computing implicit scopesMartin Odersky2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | Caches were set when information was not complete yet. Problem was exhibited by missing some `eqName` implicits when adding safe equality for Name.
* | | Make sure type parameters correspond to type args in applyOveroadedMartin Odersky2016-05-231-1/+7
| | | | | | | | | | | | | | | | | | tpd.applyOverloaded should not do type parameter inference; therefore it has to make sure all eligible alternatives have the same number of type parameters as there are type arguments.
* | | Allow auto-tupling for arguments to overloaded methodsMartin Odersky2016-05-231-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | If all overloaded variants of a method are uniary, we should also allow auto-tupling. This is necessary to make overloaded `==' methods work in cases like: xs == (1, 2)
* | | Merge pull request #1249 from dotty-staging/change-early-annotsodersky2016-05-233-2/+14
|\ \ \ | |_|/ |/| | Evaluate annotations before completing tree of definitions
| * | Add class annotations as first step of completing the class.Martin Odersky2016-05-131-1/+2
| | |
| * | Explain specific changes in later strawman proposalsMartin Odersky2016-05-122-0/+11
| | | | | | | | | | | | ... relative to CollectionStrawman1.
| * | Evaluate annotations before completing tree of definitionsMartin Odersky2016-05-101-1/+1
| |/ | | | | | | | | | | | | Motive: That way we can identify annotation macros without special name resolution rules. This was surprisingly easy.
* | Better doc commentMartin Odersky2016-05-191-1/+10
| |
* | Fix dotc bootstrap failureMartin Odersky2016-05-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During an attempted dotty bootstrap it was noted that Types.scala did not compile anymore, because `checkUnique` threw a `TypeError` during erasure. The issue was an overloaded member `name` in TermrefWithSig. In NamedType: def name: Name In TermRef: def name: TermName Before erasure, there's one member `name`, after erasure there are two (because after erasure result type counts). The error arose when trying to recompute a member of a `TermRefWithSig` where the name is `name` and the expected signature is `(Nil, ?)`. Since there are two members that match the name and the signature, `checkUnique` triggered a `TypeError`. Before adding `checkUnique`, the previous `atSignature` call would just have returned an arbitrary choice among the two alternative definitions of `name`. The fix is not to use `checkUnique` but to fall back to `d.current` in the case where several alternatives appear. Interestingly, the failure only triggers when -Ycheck options are *disabled*. I added a new test that compiles Types.scala without checks, so we catch this and possibly similar bugs in the future.
* | Handle MergeErrors in RefChecksMartin Odersky2016-05-191-1/+5
| | | | | | | | | | Used to throw an uncaught merge error in checkAllOverrides when compiling i1240c.scala.
* | Refined handling of atSignatureMartin Odersky2016-05-183-25/+29
| | | | | | | | | | | | | | | | | | | | We cannot throw a merge error if atSignature does not give a unique single denotation. Counter example is compiling dotty itself, where we get a false negative during bridge generation. Instead, atSigature needs to return a normal denotation, and we need to check separately where required that a denotation is in fact a SingleDenotation.
* | Revert: ResolveOverloaded should handle alternatives that are the same TermRefMartin Odersky2016-05-181-10/+6
| | | | | | | | | | | | | | This happens once we do not merge methods with the same signature coming from the same class. (reverted from commit 83262d090a98e2374c9b3e5a1480892397d695d3) This case no longer applies as such a situation will now give a MergeError instead.
* | Issue MergeError exception for double def situationsMartin Odersky2016-05-182-40/+65
| | | | | | | | | | | | | | | | When finding two symbols in the same class that have the same signature as seen from some prefix, issue a merge error. This is simpler and more robust than the alternative of producing an overloaded denotation and dealing with it afterwards.
* | ResolveOverloaded should handle alternatives that are the same TermRefMartin Odersky2016-05-181-6/+10
| | | | | | | | | | This happens once we do not merge methods with the same signature coming from the same class.
* | Don't copy Any constructor to Object in ErasureMartin Odersky2016-05-181-3/+9
| | | | | | | | | | | | | | | | Once we do not merge methods with same signature anymore we got an ambiguous overload between the constructors of Any and Object after erasure (when all Any methods are moved to Object). To avoid this, we map the Any constructor to the Object constructor after erasure.
* | Avoid merging denotations of different symbols in same classMartin Odersky2016-05-181-1/+8
|/ | | | | | | | #1240 shows that we need to detect ambiguous overloads of methods coming from the same base class (with different signatures there) that have the same signature in some deriving class. This was undetected before because the two methods were simply merged into one overloaded alternative.
* Merge pull request #1233 from felixmulder/topic/repl-syntax-highlightingDmitry Petrashko2016-05-1022-41/+2422
|\ | | | | Syntax highlighting for REPL using ammonite as base instead of JLine
| * Fix keywords sometimes not highlighted in multilnFelix Mulder2016-04-291-2/+2
| | | | | | | | | | When enter pressed immediately after keyword, the highlighting would be aborted
| * Add Ammonite's MIT licenseFelix Mulder2016-04-2915-231/+248
| |
| * Revert Scanners and Tokens to their original formFelix Mulder2016-04-282-44/+12
| | | | | | | | | | Since we decided to go with the non dotty-scanner approach these are unnecessary to have altered, might just as well revert them.
| * Fix `:...` commands printing erroneous messages on next newlineFelix Mulder2016-04-282-2/+2
| |
| * Fix error messages not being doubled and being on a new lineFelix Mulder2016-04-283-22/+24
| |
| * Fix highlighting tokens after newline predated by '='Felix Mulder2016-04-282-4/+4
| |
| * Fix interpret dummy line before prompt displayedFelix Mulder2016-04-281-3/+2
| |
| * Stop interpreter from interpreting twice on enterFelix Mulder2016-04-284-5/+39
| |
| * Add multiline support using ammonite multilineFilterFelix Mulder2016-04-287-94/+82
| |
| * Highlight comments, remove scanner wrapping syntax highlighterFelix Mulder2016-04-281-242/+119
| |
| * Initial implementation featuring two different highlightersFelix Mulder2016-04-2820-24/+2520
| | | | | | | | | | | | | | | | | | | | | | One was implemted by hand and the other by using dotty's parser. The one built by hand is shorter, and behaves correctly. The scanner one is unfortunately not ready for testing - there are too many things that are workarounds for it to be a good solution as of now The code added from Ammonite is licensed under MIT, not sure where to put the license - but will add it once I know.
* | eliminate self symbol in Template and ClassInfoliu fengyun2016-05-021-2/+16
| |
* | Ensure more things are completedMartin Odersky2016-04-291-1/+5
| | | | | | | | | | | | | | As noticed by @smarter we need to ensure that classes owning derived type params are completed, so that trees get the proper symbol attachments. This triggered when I changed annotation transformers - I have no idea whether how two could be related, though.