/* * Copyright (C) 2007-2016 Artima, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Automatically generated Scala interpreter transcript from: * * Programming in Scala (Third Edition) * by Martin Odersky, Lex Spoon, Bill Venners * * http://booksites.artima.com/programming_in_scala_3ed */ scala> trait Increaser { scala> def increaseOne(increaser: Increaser): Int = scala> increaseOne( scala> increaseOne(i => i + 7) // Scala 2.12 :8: error: not found: value increaseOne increaseOne(i => i + 7) // Scala 2.12 ^ scala> val stream = Arrays.stream(Array(1, 2, 3)) :7: error: not found: value Arrays val stream = Arrays.stream(Array(1, 2, 3)) ^ scala> stream.map(i => i + 1).toArray // Scala 2.12 :8: error: not found: value stream stream.map(i => i + 1).toArray // Scala 2.12 ^ scala> val f = (i: Int) => i + 1 f: Int => Int = scala> val stream = Arrays.stream(Array(1, 2, 3)) :7: error: not found: value Arrays val stream = Arrays.stream(Array(1, 2, 3)) ^ scala> stream.map(f).toArray :9: error: not found: value stream stream.map(f).toArray ^ scala> stream.map(i => f(i)).toArray :9: error: not found: value stream stream.map(i => f(i)).toArray ^ scala> val f: IntUnaryOperator = i => i + 1 :7: error: not found: type IntUnaryOperator val f: IntUnaryOperator = i => i + 1 ^ scala> val stream = Arrays.stream(Array(1, 2, 3)) :7: error: not found: value Arrays val stream = Arrays.stream(Array(1, 2, 3)) ^ scala> stream.map(f).toArray :9: error: not found: value stream stream.map(f).toArray ^