summaryrefslogtreecommitdiff
path: root/test/files/run/constrained-types.check
Commit message (Collapse)AuthorAgeFilesLines
* SI-1931 Hide Predef.any2stringadd in REPLSom Snytt2015-07-061-4/+4
| | | | | | | | | | | | | | User imports that reference Predef are relocated to the top of the wrapping template so that they can hide implicits defined in Predef. Only one import from Predef is retained for special treatment. This is simple and sane. The test shows that `import Predef._` restores Predef implicits even if a user-defined term would normally be in scope. A smart `:import` command to turn off or quarantine imports explicitly would allow fine-grained control.
* SI-9206 Update REPL welcome messageSom Snytt2015-06-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Everyone knows that a `help` command will result in `more information`. This commit moves the version string to the second line and adds some verve to the welcome. If anyone can't live without the old banner, they are now able to configure it explicitly, so there is still no blood on our hands. ``` $ scala Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40). Type in expressions to have them evaluated. Type :help for more information. scala> :quit $ skala Welcome to Scala! version 2.11.7-20150623-155244-eab44dd092 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40). Type in expressions for evaluation. Or try :help. scala> :quit ``` REPL tests now lop off the actual length of the welcome header; or, if necessary, remove the version number from a header embedded in output.
* SI-9206 Fix REPL code indentationSom Snytt2015-06-191-4/+4
| | | | | | | | | | To make code in error messages line up with the original line of code, templated code is indented by the width of the prompt. Use the raw prompt (without ANSI escapes or newlines) to determine the indentation. Also, indent only once per line.
* SI-4563 friendlier behavior for Ctrl+D in the REPLAntoine Gourlay2014-07-291-1/+1
| | | | | | | | | | | | | Closing the REPL with Ctrl+D does not issue a newline, so the user's prompt displays on the same line as the `scala>` prompt. This is bad. We now force a newline before closing the interpreter, and display `:quit` while we're at it so that people know how to exit the REPL (since `exit` doesn't exist anymore). The tricky part was to only add a newline when the console is interrupted, and *not* when it is closed by a command (like `:quit`), since commands are processed after their text (including newline) has been sent to the console.
* SI-8185 Correct grammar for single-warning compilation runFrançois Garillot2014-05-141-4/+4
|
* SI-8151 Remove -Yself-in-annots and associated implementationJason Zaugg2014-01-151-10/+0
| | | | | | | | | | | | | | | This experimental option typechecked arguments of annotations with an injected value in scope named `self`: @Foo(self.foo < 1) This has been slated for removal [1] for some time. This commit removes it in one fell swoop, without any attempt at source compatibility with code that constructs or pattern matches on AnnotatedType. [1] https://groups.google.com/d/msg/scala-internals/VdZ5UJwQFGI/C6tZ493Yxx4J
* SI-7985 Typecheck args after failure to typecheck functionJason Zaugg2013-10-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | `missing1.foo(missing2)` now reports `missing1` and `missing2` as not found. Previously, only the first was reported. The arguments are typed with an expected type ErrorType. We propagate this through as the inferred type of anonymous function parameters to avoid issuing cascading "missing parameter type" errors in code like: scala> Nil.mapp(x => abracadabra) <console>:8: error: value mapp is not a member of object Nil Nil.mapp(x => abracadabra) ^ <console>:8: error: not found: value abracadabra Nil.mapp(x => abracadabra) ^ This was in response to unwanted changes in the output of existing neg tests; no new test is added. Similarly, we refine the errors in neg/t6436b.scala by to avoid cascaded errors after: type mismatch; found: StringContext, required: ?{def q: ?}
* Cull extraneous whitespace.Paul Phillips2013-09-181-8/+2
| | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2013-02-101-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: Fix for paramaccessor alias regression. Expanded bytecode testing code. SI-5675 Discard duplicate feature warnings at a position accommodates pull request feedback term and type reftrees are now reified uniformly SI-6591 Reify and path-dependent types SI-7096 SubstSymMap copies trees before modifying their symbols SI-6961 no structural sharing in list serialization SI-6187 Make partial functions re-typable [backport] SI-6478 Fixing JavaTokenParser ident SI-7100 Fixed infinite recursion in duplicators SI-6146 More accurate prefixes for sealed subtypes. SI-5082 Cycle avoidance between case companions SI-6113 typeOf now works for type lambdas SI-5824 Fix crashes in reify with _* SI-7026: parseTree should never return a typed one SI-7070 Turn restriction on companions in pkg objs into warning Conflicts: src/compiler/scala/reflect/reify/codegen/GenSymbols.scala src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/collection/immutable/List.scala src/reflect/scala/reflect/internal/TreeInfo.scala src/reflect/scala/reflect/internal/Types.scala src/reflect/scala/reflect/internal/settings/MutableSettings.scala src/reflect/scala/reflect/runtime/Settings.scala test/files/buildmanager/t2650_1/t2650_1.check test/files/buildmanager/t2657/t2657.check test/files/neg/t3234.check test/files/run/idempotency-this.check test/files/run/macro-typecheck-macrosdisabled2.check test/files/run/showraw_tree.check test/files/run/showraw_tree_ids.check test/files/run/showraw_tree_kinds.check test/files/run/showraw_tree_types_ids.check test/files/run/showraw_tree_types_typed.check test/files/run/showraw_tree_types_untyped.check test/files/run/showraw_tree_ultimate.check test/files/run/t2886.check test/files/run/t5225_2.check test/files/run/t5374.check test/files/run/t5374.scala test/files/run/t6329_repl.check test/files/run/toolbox_typecheck_macrosdisabled2.check
| * SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-081-4/+4
| | | | | | | | | | | | | | | | | | | | When -feature has not been enabled, we were double counting identical feature warnings that were emitted at the same position. Normal error reporting only reports the first time a warning appears at a position; feature warning counter incrementing should behave the same way. @hubertp: Fixed .check files that were broken in the original commit.
* | SI-6918 Changes REPL output from "defined module" to "defined object"Simon Ochsenreither2013-01-051-2/+2
|/
* Restored :warnings to working order.Paul Phillips2012-08-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | As seen here. scala> class A { @deprecated("foo") def a = 1 } warning: there were 1 deprecation warnings; re-run with -deprecation for details defined class A scala> :warnings <console>:7: warning: @deprecated now takes two arguments; see the scaladoc. class A { @deprecated("foo") def a = 1 } ^ scala> val x = 5 toString warning: there were 1 feature warnings; re-run with -feature for details x: String = 5 scala> :warnings <console>:7: warning: postfix operator toString should be enabled by making the implicit value language.postfixOps visible. This can be achieved by adding the import clause 'import language.postfixOps' or by setting the compiler option -language:postfixOps. See the Scala docs for value scala.language.postfixOps for a discussion why the feature should be explicitly enabled. val x = 5 toString ^
* Fixed tests to account for SIP 18Martin Odersky2012-04-131-0/+7
|
* Begone t1737...Hubert Plociniczak2011-11-021-2/+2
|
* Added *.log and build/ to gitignore so partest/...Josh Suereth2011-11-231-2/+2
| | | | | | | Added *.log and build/ to gitignore so partest/ant artifacts don't show up in our commit messages. Also fixed whitespace issues arising from the filter-branch history rewrite for git move.
* Selective dealiasing when printing errors.Paul Phillips2011-10-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Important note for busy commit log skimmers *** Symbol method "fullName" has been trying to serve the dual role of "how to print a symbol" and "how to find a class file." It cannot serve both these roles simultaneously, primarily because of package objects but other little things as well. Since in the majority of situations we want the one which corresponds to the idealized scala world, not the grubby bytecode, I went with that for fullName. When you require the path to a class (e.g. you are calling Class.forName) you should use javaClassName. package foo { package object bar { class Bippy } } If sym is Bippy's symbol, then sym.fullName == foo.bar.Bippy sym.javaClassName == foo.bar.package.Bippy *** End important note *** There are many situations where we (until now) forewent revealing everything we knew about a type mismatch. For instance, this isn't very helpful of scalac (at least in those more common cases where you didn't define type X on the previous repl line.) scala> type X = Int defined type alias X scala> def f(x: X): Byte = x <console>:8: error: type mismatch; found : X required: Byte def f(x: X): Byte = x ^ Now it says: found : X (which expands to) Int required: Byte def f(x: X): Byte = x ^ In addition I rearchitected a number of methods involving: - finding a symbol's owner - calculating a symbol's name - determining whether to print a prefix No review.
* Finished reverting the misbegotten r23262, no r...Paul Phillips2011-05-261-1/+1
| | | | | Finished reverting the misbegotten r23262, no review.
* Enhancing the repl-testing code by turning it i...Paul Phillips2011-04-051-57/+75
| | | | | | | | | | Enhancing the repl-testing code by turning it into a transcript producing machine. "Here's some code." "Here's a transcript!" "Good day to you, sir!" "No, good day to YOU!" These changes are awesome. Look at the checkfile diffs for god's sake, they'll make you weep with joy. No review.
* I keep seeing huge simplifications available in...Paul Phillips2011-02-011-1/+1
| | | | | | | | | I keep seeing huge simplifications available in the repl. Lot of interesting features have come to town since it was first conceived. In this commit I give the internal names some tips on aesthetics, and put each line in its own package like civilized artificial constructs. No review.
* Moved ClassfileAnnotation/StaticAnnotation/Anno...Paul Phillips2010-12-061-4/+4
| | | | | | | Moved ClassfileAnnotation/StaticAnnotation/Annotation/TypeConstraint into scala.annotation and enabled the deprecated type aliases in scala.* to point there. Also enclosed is a new starr to bootstrap. No review.
* Modification to the widening logic to treat loc...Paul Phillips2010-10-141-2/+2
| | | | | | | | | | | | | | | | | | Modification to the widening logic to treat locally defined symbols like final members thus allowing more constants to be inlined. Concretely, that means that in code like this: def f: Unit = { val b = false ; if (b) println("ok") } The call to println is no longer generated at all, and in this code: def f(x: Int) = { val X = 1 ; val Y = 2; x match { case X => 1 ; case Y => 2 } } A tableswitch is generated instead of the present if/then/else. I also added a big comment to the former widenIfNotFinal (now widenIfNecessary for obvious reasons.) Review by rytz.
* closes #1569, #3731: refactored dependent metho...Adriaan Moors2010-09-161-2/+2
| | | | | | | | | | | | | | closes #1569, #3731: refactored dependent method types to get rid of debruijn indices and use singleton types instead. this is the core of the dependent types refactoring, no implicit or inference changes (one baffling discovery: resultType should drop annotations that don't subclass TypeConstraint, even in the trivial case... wow -- thanks to Tiark for helping me figure it out on a terrace in Barcelona TODO: probably need a more principled approach to the propagation of plugin type-annotations) review by odersky
* Some repl cleanups and debugging conveniences.Paul Phillips2010-02-211-1/+1
|
* Named and default argumentsLukas Rytz2009-05-301-1/+1
| | | | | | | - MethodTypes now have (params: List[Symbol]) - "copy"-methods for case classes - the "copy" object in the compiler is now called "treeCopy"
* some small changes to implicits handling, exist...Martin Odersky2009-04-231-4/+4
| | | | | | some small changes to implicits handling, existential abstraction, type parameter bounds checking
* hopefully fixed the build by fixing deSkolemize...Martin Odersky2009-02-161-1/+1
| | | | | | hopefully fixed the build by fixing deSkolemize, and adapting the new collection libraries to stricter override checking.
* Merge from the annots-normtrees branch.Lex Spoon2007-11-281-0/+136
now use compiler trees instead of reflect trees. In many cases, annotations on types can be rewritten instead of discarded as the types undergo various operations. Also, -Yself-in-annots has been added.