repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
amitkumarj441/DynaML | src/main/scala-2.11/io/github/mandar2812/dynaml/DynaMLSSH.scala | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
amitkumarj441/DynaML | dynaml-pipes/src/main/scala-2.11/io/github/mandar2812/dynaml/pipes/Encoder.scala | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/POMP.scala | package io.github.mandar2812.dynaml.models.statespace
import java.io.Serializable
import breeze.linalg.DenseVector
import breeze.numerics._
import breeze.stats.distributions._
import scala.language.implicitConversions
object POMP {
type Eta = Vector[Double]
type Gamma = Double
type Observation = Double
type... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/kernels/PolynomialKernel.scala | <gh_stars>0
package io.github.mandar2812.dynaml.kernels
import breeze.linalg.{DenseMatrix, DenseVector}
/**
* Standard Polynomial SVM Kernel
* of the form K(x,y) = (x<sup>T</sup> . y + 1.0)<sup>r</sup>
*/
class PolynomialKernel(
private var degree: Int = 2,
private var offset: Double = 1.0)
extends SVMKe... |
amitkumarj441/DynaML | dynaml-repl/src/main/scala-2.11/io/github/mandar2812/dynaml/repl/DynaMLInterpreter.scala | package io.github.mandar2812.dynaml.repl
import java.io.{OutputStream, PrintStream}
import java.util.regex.Pattern
import ammonite.interp.{Interpreter, Preprocessor}
import ammonite.ops.{Path, exists, ls}
import ammonite.runtime.{Evaluator, Frame, Storage}
import ammonite.util.Util.{CodeSource, VersionedWrapperId, ne... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/Parameters.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/Parameters.scala
package io.github.mandar2812.dynaml.models.statespace
import breeze.linalg.{DenseMatrix, DenseVector, diag}
import breeze.numerics.exp
import breeze.stats.distributions.{Gaussian, Rand}
sealed trait Parameters {
... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/analysis/PartitionedVectorField.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/analysis/PartitionedVectorField.scala
package io.github.mandar2812.dynaml.analysis
import io.github.mandar2812.dynaml.algebra.PartitionedVector
import io.github.mandar2812.dynaml.algebra.PartitionedMatrixOps._
import spire.algebra.{Eq, Field, InnerP... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/utils/TensorBasis.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/utils/TensorBasis.scala
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The AS... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/DynaMLPipe.scala | <gh_stars>0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may no... |
amitkumarj441/DynaML | dynaml-pipes/src/test/scala-2.11/io/github/mandar2812/dynaml/pipes/DataPipesSpec.scala | package io.github.mandar2812.dynaml.pipes
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by mandar on 13/7/16.
*/
class DataPipesSpec extends FlatSpec with Matchers {
"A Data Pipe" should "have type consistency" in {
val pipe = DataPipe((x: Int) => x+1)
val num = pipe(1)
assert(num == 2)... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/utils/PCAScaler.scala | package io.github.mandar2812.dynaml.utils
import breeze.linalg.eig.Eig
import breeze.linalg.{DenseMatrix, DenseVector, eig}
import io.github.mandar2812.dynaml.pipes.{ReversibleScaler, Scaler}
/**
* Transforms data by projecting
* on the principal components (eigen-vectors)
* of the sample covariance matrix.
*... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/kernels/KernelOps.scala | package io.github.mandar2812.dynaml.kernels
import breeze.generic.UFunc
/**
* @author mandar2812 date: 26/10/2016.
*/
@deprecated
trait KernelOps[+This] extends Any {
def repr: This
/** Alias for :+(b) for all b. */
final def +[TT >: This, B, That](b: B)(implicit op: KernelOpAdd.Impl2[TT, B, That]) = op(re... |
amitkumarj441/DynaML | dynaml-examples/src/main/scala-2.11/io/github/mandar2812/dynaml/examples/TestSUSY.scala | package io.github.mandar2812.dynaml.examples
import java.io.File
import breeze.linalg.{DenseMatrix, DenseVector}
import com.github.tototoshi.csv.CSVWriter
import io.github.mandar2812.dynaml.kernels.{SVMKernel, RBFKernel}
import io.github.mandar2812.dynaml.models.KernelizedModel
import io.github.mandar2812.dynaml.mode... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/modelpipe/GPRegressionPipe.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/modelpipe/GPRegressionPipe.scala
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF ... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/evaluation/MetricsTF.scala | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/modelpipe/ModelPipe.scala | package io.github.mandar2812.dynaml.modelpipe
import io.github.mandar2812.dynaml.models.Model
import io.github.mandar2812.dynaml.DynaMLPipe._
import io.github.mandar2812.dynaml.pipes.{DataPipe, ReversibleScaler}
/**
* Top level trait for Pipes returning ML models.
*/
trait ModelPipe[-Source, T, Q, R, +M <: Model[... |
amitkumarj441/DynaML | project/Dependencies.scala | import sbt._
object Dependencies {
val scala = "2.11.8"
val platform: String = {
// Determine platform name using code similar to javacpp
// com.googlecode.javacpp.Loader.java line 60-84
val jvmName = System.getProperty("java.vm.name").toLowerCase
var osName = System.getProperty("os.name").toLowe... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/svm/LSSVMSparkModel.scala | package io.github.mandar2812.dynaml.models.svm
import breeze.linalg.{DenseMatrix, DenseVector}
import breeze.numerics.sqrt
import com.github.tototoshi.csv.CSVReader
import com.tinkerpop.frames.FramedGraphFactory
import io.github.mandar2812.dynaml.utils.MinMaxAccumulator
import org.apache.spark.{Accumulator, SparkConte... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/utils/GaussianScalerTF.scala | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
amitkumarj441/DynaML | dynaml-examples/src/main/scala-2.11/io/github/mandar2812/dynaml/examples/TestNNWineQuality.scala | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/ParticleFilter.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/ParticleFilter.scala
package io.github.mandar2812.dynaml.models.statespace
import POMP._
import DataTypes._
import State._
import SimData._
import akka.stream.scaladsl.Source
import scala.language.higherKinds._
import breeze.stats... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/models/statespace/State.scala | package io.github.mandar2812.dynaml.models.statespace
import breeze.linalg.DenseVector
sealed trait State {
import State._
def map(f: DenseVector[Double] => DenseVector[Double]): State = State.map(this)(f)
def flatten: Vector[Double] = State.flatten(this)
def head: Double = State.head(this)
def |+|(that: S... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/kernels/MLPKernel.scala | <reponame>amitkumarj441/DynaML
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"Li... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/kernels/DiracKernel.scala | <gh_stars>0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may no... |
amitkumarj441/DynaML | dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/implicits/package.scala | <filename>dynaml-core/src/main/scala-2.11/io/github/mandar2812/dynaml/tensorflow/implicits/package.scala
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The AS... |
iykeawauma/awadevops | sbt-example/build.sbt | lazy val root = (project in file(".")).
settings(
name := "SBT_Example",
version := "1.1-SNAPSHOT",
scalaVersion := "2.11.4"
)
resolvers += "Artifactory" at "http://localhost:8081/artifactory/jcenter"
publishTo := Some("Artifactory Realm" at "http://localhost:8081/artifactory/libs-snapshot-local;b... |
iykeawauma/awadevops | sbt-example/src/main/scala/Example.scala | <filename>sbt-example/src/main/scala/Example.scala
object Example {
def main(args: Array[String]) = println("Sample Scala Project")
} |
ihji/dotty | tests/pos/objXfun.scala | <gh_stars>0
object Foo extends (Int => Int) { // OK
def apply(x: Int) = x
}
enum class E(x: Int) // used to generate Int => new E(x) as the parent of object E --> crash
object E {
case C(x: Int) extends E(x)
}
|
ihji/dotty | sbt-bridge/test/xsbt/TestDriver.scala | package xsbt
import dotty.tools.dotc._
import core.Contexts._
class TestDriver extends Driver {
protected def newCompiler(implicit ctx: Context): Compiler = new Compiler
override protected def sourcesRequired = false
def getCompiler(args: Array[String], rootCtx: Context) = {
val (fileNames, ctx) = setup(a... |
ihji/dotty | tests/neg/phantom-assume-1.scala | object Boo extends Phantom {
type BooAny = this.Any
def assume1: BooAny = assume() // error: method assume in trait Phantom does not take parameters
}
|
ihji/dotty | tests/run/phantom-decls-5.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
new Boo5[Blinky]... |
ihji/dotty | tests/run/phantom-5.scala | <reponame>ihji/dotty<filename>tests/run/phantom-5.scala
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
de... |
ihji/dotty | tests/neg/equality.scala | object equality {
case class Str(str: String)
case class Num(x: Int)
case class Other(x: Int)
trait Option[+T]
case class Some[+T](x: T) extends Option[T]
case object None extends Option[Nothing]
implicit def eqStr: Eq[Str, Str] = Eq
implicit def eqNum: Eq[Num, Num] = Eq
implicit def eqOption[T, ... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/ByNameClosures.scala | package dotty.tools.dotc
package transform
import TreeTransforms._
import core._
import Symbols._
import SymDenotations._
import Contexts._
import Types._
import Flags._
import Decorators._
import DenotTransformers.IdentityDenotTransformer
import core.StdNames.nme
/** This phase translates arguments to call-by-name p... |
ihji/dotty | tests/idempotency/BootstrapChecker.scala |
object Test {
def main(args: Array[String]): Unit =
IdempotencyCheck.checkIdempotency("../out/dotty")
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/classpath/ClassPathFactory.scala | /*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package dotty.tools.dotc.classpath
import dotty.tools.io.{AbstractFile, VirtualDirectory}
import dotty.tools.io.Path.string2path
import dotty.tools.dotc.config.Settings
import FileUtils.AbstractFileOps
import dotty.tools.io.ClassPath
import dotty.tools.dot... |
ihji/dotty | bot/src/dotty/tools/bot/util/HttpClientAux.scala | package dotty.tools.bot.util
import org.http4s._
import scalaz.concurrent.Task
import org.http4s.headers.{ Accept, Authorization }
object HttpClientAux {
def uriFromString(url: String): Task[Uri] =
Uri.fromString(url).fold(Task.fail, Task.now)
implicit class RicherTask(val task: Task[Request]) extends AnyVal... |
ihji/dotty | tests/neg/phantom-class-type-members.scala | import Boo._
object Test {
def main(args: Array[String]): Unit = {
val a = new Bar()
foo(a.asInstanceOf[Foo{type T = BooNothing}].y) // error
a match {
case a: Foo{type T = BooNothing} => a.y // error
}
val b = new Baz
b.asInstanceOf[Foo{type T = BooAny}].z(any) // error
b matc... |
ihji/dotty | tests/run/i2738.scala | object Test {
def main(args: Array[String]): Unit = {
foo(1)
foo("a")
baz(2)
baz("b")
}
def foo[X <: Int](x: X) = {
def bar = printlnThisMethodName()
printlnThisMethodName()
bar
}
def foo(x: String) = {
def bar = printlnThisMethodName()
printlnThisMethodName()
bar
... |
ihji/dotty | compiler/src/dotty/tools/dotc/reporting/Reporter.scala | <gh_stars>0
package dotty.tools
package dotc
package reporting
import core.Contexts._
import util.{SourcePosition, NoSourcePosition}
import core.Decorators.PhaseListDecorator
import collection.mutable
import config.Printers
import java.lang.System.currentTimeMillis
import core.Mode
import dotty.tools.dotc.core.Symbols... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/RemoveUnnecessaryNullChecks.scala | package dotty.tools.dotc
package transform.localopt
import core.Constants.{Constant, NullTag}
import core.Contexts.Context
import core.Symbols._
import core.Types._
import core.Flags._
import ast.Trees._
import scala.collection.mutable
/** Eliminated null checks based on the following observations:
*
* - (this) c... |
ihji/dotty | tests/neg/phantom-Eq.scala | /* This is a example of how to implement Eq using erasable phantom types.
*
* See also: ../pos/phantomEq.scala
*/
object PhantomEqTest {
import EqUtil._
"abc" === "abc"
1 === 4
1 === "abc" // error
"ghi" === 4 // error
0 === Nil // error
List(1, 2) === 1 // error
List(1, 2) === "" // error
}
obj... |
ihji/dotty | tests/run/phantom-4.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
fun4(3, 4, boo... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/ConstantFold.scala | package dotty.tools.dotc
package transform.localopt
import core.Contexts.Context
import core.Symbols._
import core.Types._
import typer.ConstFold
import ast.Trees._
import Simplify.desugarIdent
/** Various constant folding.
*
* - Starts/ends with the constant folding implemented in typer (ConstFold).
*
* - Join... |
ihji/dotty | tests/run/phantom-methods-14.scala | import scala.reflect.ClassTag
object Test {
def main(args: Array[String]): Unit = {
bar1(Foo.a)
bar2(Foo.a)(null)
}
def bar1(ev: Foo.A) = ()
def bar2(ev: Foo.A)(implicit c: ClassTag[Int]) = implicitly[ClassTag[Int]]
}
object Foo extends Phantom {
type A <: this.Any
def a: A = assume
}
|
ihji/dotty | tests/run/enum-approx.scala | <reponame>ihji/dotty
enum class Fun[-T, +U >: Null] {
def f: T => U = null
}
object Fun {
case Identity[T, U >: Null](override val f: T => U) extends Fun[T, U]
case ConstNull {
override def f = x => null
}
case ConstNullClass() {
override def f = x => null
}
case ConstNullSimple
}
object Test {
... |
ihji/dotty | compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala | <reponame>ihji/dotty<filename>compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala<gh_stars>0
package dotty.tools
package dotc
package parsing
import util.Chars._
abstract class CharArrayReader { self =>
val buf: Array[Char]
protected def startFrom = 0
/** Switch whether unicode should be decoded */
... |
ihji/dotty | tests/run/phantom-poly-4.scala | <filename>tests/run/phantom-poly-4.scala
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Arra... |
ihji/dotty | tests/neg/phantom-trait-4.scala | <filename>tests/neg/phantom-trait-4.scala
class Foo {
object Boo1 extends Phantom // error
def foo = {
object Boo2 extends Phantom // error
42
}
}
object Foo {
object Boo1 extends Phantom
def foo = {
object Boo2 extends Phantom // error
42
}
}
package foo {
object Boo1 extends Phanto... |
ihji/dotty | tests/pos/i2426.scala | class Foo @deprecated("foo", "2.11.0") (x: Int)
class Bar @deprecated(x: Int)
class Baz1 @deprecated(implicit c: C)
class Baz2 @deprecated()(implicit c: C)
class Baz3 @deprecated()()(implicit c: C)
object Test {
implicit val c: C = obj
new Baz1
new Baz2
new Baz3()
}
class D(implicit x: C)
class C
object ob... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/patmat/Space.scala | package dotty.tools.dotc
package transform
package patmat
import core._
import Types._
import Contexts._
import Flags._
import ast.Trees._
import ast.tpd
import Decorators._
import Symbols._
import StdNames._
import NameOps._
import Constants._
import reporting.diagnostic.messages._
import config.Printers.{ exhaustivi... |
ihji/dotty | tests/run/phantom-self-1.scala | object Test {
def main(args: Array[String]): Unit = {
Boo.any
Boo.any2
}
}
object Boo extends Phantom with T
trait T { self: Phantom =>
type X = self.Any
def any: X = self.assume
def any2: X = assume
}
|
ihji/dotty | tests/run/phantom-2.scala | <filename>tests/run/phantom-2.scala
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[Stri... |
ihji/dotty | library/src/scala/Phantom.scala | /* Defined synthetically
package scala
trait Phantom {
/** Phantom.Any does not extend scala.Any */
protected /*final*/ trait Any
protected final trait Nothing extends this.Any
protected final def assume: this.Nothing
}
*/
|
ihji/dotty | tests/idempotency/Checker.scala | <filename>tests/idempotency/Checker.scala
object Test {
def main(args: Array[String]): Unit =
IdempotencyCheck.checkIdempotency("../out/idempotency")
}
|
ihji/dotty | tests/neg/phantom-multiversal.scala | <gh_stars>0
class BooFunDef1 {
import Universe1._
import UniverseA._
fun1(one, two)
fun1(one, b) // error
fun1(b, a) // error // error
funA(a, b)
funA(a, one) // error
funA(two, one) // error // error
funMulti(a, one, 42)
funMulti(a, b, 42) // error
funMulti(one, two, one) // error // error
... |
ihji/dotty | tests/neg/phantom-instanceOf-2.scala |
class phantomInstanceOf2 {
import Boo._
boo[Blinky].asInstanceOf[Any] // error
boo[Blinky].asInstanceOf[Nothing] // error
boo[Blinky].asInstanceOf[Blinky] // error
boo[Blinky].asInstanceOf[BooAny] // error
}
object Boo extends Phantom {
type BooAny <: this.Any
type Blinky <: this.Any
def boo[B <: this... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/Jumpjump.scala | <filename>compiler/src/dotty/tools/dotc/transform/localopt/Jumpjump.scala
package dotty.tools.dotc
package transform.localopt
import core.TypeErasure
import core.Constants.Constant
import core.Contexts.Context
import core.Decorators._
import core.Symbols._
import ast.Trees._
import scala.collection.mutable
import conf... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/LinkScala2Impls.scala | <reponame>ihji/dotty
package dotty.tools.dotc
package transform
import core._
import TreeTransforms._
import Contexts.Context
import Flags._
import SymUtils._
import Symbols._
import SymDenotations._
import Types._
import Decorators._
import DenotTransformers._
import StdNames._
import NameOps._
import Phases._
import... |
ihji/dotty | tests/run/phantom-methods-12.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomRefErasure,phantomErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
fun1(
{ println... |
ihji/dotty | compiler/test/dotty/tools/dotc/repl/TestREPL.scala | package dotty
package tools.dotc
package repl
import core.Contexts.Context
import collection.mutable
import java.io.{StringWriter, PrintStream}
import dotty.tools.io.{ PlainFile, Directory }
import org.junit.Test
/** A subclass of REPL used for testing.
* It takes a transcript of a REPL session in `script`. The tra... |
ihji/dotty | bot/src/dotty/tools/bot/model/Drone.scala | package dotty.tools
package bot
package model
import io.circe._
import io.circe.generic.auto._
import io.circe.syntax._
import org.http4s._
import org.http4s.circe._
import org.http4s.client.Client
import scalaz.concurrent.Task
import bot.util.HttpClientAux
object Drone {
import HttpClientAux._
case class Buil... |
ihji/dotty | library/src/scala/Eq.scala | <reponame>ihji/dotty
package scala
import annotation.implicitNotFound
import scala.collection.{GenSeq, Set}
/** A marker trait indicating that values of type `L` can be compared to values of type `R`. */
@implicitNotFound("Values of types ${L} and ${R} cannot be compared with == or !=")
sealed trait Eq[-L, -R]
/** B... |
ihji/dotty | tests/neg/phantom-class-type-parameters.scala | <reponame>ihji/dotty
import Boo._
object Test {
def main(args: Array[String]): Unit = {
val a = new Foo[BooAny](any)
foo(a.asInstanceOf[Foo[BooNothing]].x) // error
foo(a.asInstanceOf[Foo[BooNothing]].y) // error
a match {
case a: Foo[BooNothing] => a.x // error
}
val b = new Foo[BooN... |
ihji/dotty | tests/neg/phantom-multiversal-AndOr.scala | <gh_stars>0
class BooFunDef1 {
import Universe1._
import UniverseA._
def fun1(b: One | A) = ??? // error
def fun2(b: A | One) = ??? // error
def fun3(b: A | One | Any) = ??? // error // error
def fun4(b: A & One) = ??? // error
def fun5(b: One & A) = ??? // error
def fun6(b: A & One & Any) = ??? // e... |
ihji/dotty | compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala | <reponame>ihji/dotty
package dotty.tools.dotc
package core
package tasty
import scala.collection.mutable
import TastyFormat._
import TastyBuffer.NameRef
import Names.{Name, TermName, termName, EmptyTermName}
import NameKinds._
import java.util.UUID
object TastyUnpickler {
class UnpickleException(msg: String) extend... |
ihji/dotty | tests/neg/customArgs/phantom-overload-2.scala | <filename>tests/neg/customArgs/phantom-overload-2.scala
class phantomOverload2 {
import Boo._
def foo1() = ???
def foo1(x: A) = ??? // error
def foo1(x1: B)(x2: N) = ??? // error
def foo2(x1: Int, x2: A) = ???
def foo2(x1: A)(x2: Int) = ??? // error
def foo2(x1: N)(x2: A)(x3: Int) = ??? // error
def... |
ihji/dotty | tests/run/phantom-methods-11.scala | <reponame>ihji/dotty
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomRefErasure,phantomErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
... |
ihji/dotty | tests/run/switches.scala | <gh_stars>0
import annotation.switch
object Test extends App {
val x = 3
final val Y = 3
val x1 = x match {
case 0 => 0
case 1 => 1
case 2 => 2
case Y => 3
}
val x2 = (x: @switch) match {
case 0 => 0
case 1 | 2 => 2
case Y => 3
case _ => 4
}
val x3 = (x: @switch) match ... |
ihji/dotty | compiler/test/dotty/tools/vulpix/TestConfiguration.scala | package dotty
package tools
package vulpix
object TestConfiguration {
implicit val defaultOutputDir: String = "../out/"
implicit class RichStringArray(val xs: Array[String]) extends AnyVal {
def and(args: String*): Array[String] = {
val argsArr: Array[String] = args.toArray
xs ++ argsArr
}
}... |
ihji/dotty | tests/neg/phantom-trait-1.scala | <gh_stars>0
object Boo extends Phantom {
override val assume: this.Nothing = super.assume // error
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/Devalify.scala | <reponame>ihji/dotty
package dotty.tools.dotc
package transform.localopt
import core.Constants.Constant
import core.Contexts.Context
import core.Flags._
import core.Symbols._
import core.Types._
import ast.Trees._
import scala.collection.mutable
import config.Printers.simplify
import Simplify._
import transform.SymUti... |
ihji/dotty | tests/neg/reference-phantom-type-2.scala | object MyPhantoms extends Phantom {
type Inky <: this.Any
type Blinky <: this.Any
type Pinky <: Inky
type Clyde <: Pinky
def pinky: Pinky = assume
def clyde: Clyde = assume
}
import MyPhantoms._
object MyApp {
def run(phantom: Inky) = println("run")
def hide(phantom: Blinky) = println("run")
run(pi... |
ihji/dotty | project/plugins.sbt | <reponame>ihji/dotty<filename>project/plugins.sbt
// Add personal SBT plugins for IDEs, etc to `local-plugins.sbt`
//
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
// Scala IDE project file generator
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0")
addSbtPlugin("org.scala-... |
ihji/dotty | tests/pos/phantom-in-value-class.scala |
object PhantomInValueClass {
import BooUtil._
new VC("ghi").foo(boo)
}
object BooUtil extends Phantom {
type Boo <: this.Any
def boo: Boo = assume
class VC[T](val x: T) extends AnyVal {
def foo(b: Boo) = println(x)
}
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/InlineLocalObjects.scala | <filename>compiler/src/dotty/tools/dotc/transform/localopt/InlineLocalObjects.scala
package dotty.tools.dotc
package transform.localopt
import core.Constants.Constant
import core.Contexts.Context
import core.Decorators._
import core.Names.Name
import core.NameKinds.LocalOptInlineLocalObj
import core.Types.Type
import ... |
ihji/dotty | tests/pos/harmonize.scala | <reponame>ihji/dotty<gh_stars>0
object Test {
def main(args: Array[String]) = {
val x = true
val n = 1
inline val nn = 2
val y = if (x) 'A' else n
val z: Int = y
val yy1 = n match {
case 1 => 'A'
case 2 => n
case 3 => 1.0
}
val zz1: AnyVal = yy1 // no widening
... |
ihji/dotty | tests/neg/i1641.scala | <filename>tests/neg/i1641.scala
package bar { object bippy extends (Double => String) { def apply(x: Double): String = "Double" } }
package object println { def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)" }
object Test {
def main(args: Array[String]): Unit = {
println(bar.bippy(5.5)) // error
println(ba... |
ihji/dotty | tests/pos/phantom-Eq2/Phantom-Eq_1.scala | <reponame>ihji/dotty<gh_stars>0
/* This is a version of ../pos/phantomEq.scala that tests phantom with separate compilation */
object EqUtil extends Phantom {
type PhantomEq[-L, -R] <: this.Any
type PhantomEqEq[T] = PhantomEq[T, T]
implicit class EqualsDeco[T](val x: T) extends AnyVal {
def ===[U] (y: U)(i... |
ihji/dotty | tests/run/phantom-assume-1.scala |
object Test {
import Boo._
def main(args: Array[String]): Unit = {
Boo.assume1
Boo.assume2
Boo.assume3
}
}
object Boo extends Phantom {
type BooAny = this.Any
def assume1: BooAny = assume
def assume2: BooAny = this.assume
def assume3: BooAny = Boo.assume
}
|
ihji/dotty | tests/run/phantom-methods-8.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomRefErasure,phantomErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
pacFun4(inky)
}
... |
ihji/dotty | tests/neg/t5729.scala | trait T[X]
object Test {
def join(in: Seq[T[_]]): Int = ???
def join[S](in: Seq[T[S]]): String = ???
join(null: Seq[T[_]]) // error: ambiguous
}
object C {
def join(in: Seq[List[_]]): Int = error("TODO")
def join[S](in: Seq[List[S]]): String = error("TODO")
join(Seq[List[Int]]()) // error: ambiguous
//
... |
ihji/dotty | tests/neg/phantom-trait-2.scala | <gh_stars>0
object Boo1 extends Phantom {
class A extends this.Any // error
class B extends this.Nothing // error
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/transform/LiftTry.scala | <filename>compiler/src/dotty/tools/dotc/transform/LiftTry.scala
package dotty.tools.dotc
package transform
import TreeTransforms._
import core.DenotTransformers._
import core.Symbols._
import core.Contexts._
import core.Types._
import core.Flags._
import core.Decorators._
import core.NameKinds.LiftedTreeName
import No... |
ihji/dotty | tests/pos/reference/phantom-types.scala | <filename>tests/pos/reference/phantom-types.scala
object MyPhantoms extends Phantom {
type Inky <: this.Any
type Blinky <: this.Any
type Pinky <: Inky
type Clyde <: Pinky
def pinky: Pinky = assume
def clyde: Clyde = assume
}
import MyPhantoms._
object MyApp {
def run(phantom: Inky) = println("run")
de... |
ihji/dotty | tests/pos/enum-List-control.scala | <reponame>ihji/dotty<filename>tests/pos/enum-List-control.scala
abstract sealed class List[T] extends Enum
object List {
final case class Cons[T](x: T, xs: List[T]) extends List[T] {
def enumTag = 0
}
final case class Nil[T]() extends List[T] {
def enumTag = 1
}
}
object Test {
import List._
val xs ... |
ihji/dotty | compiler/src/dotty/tools/dotc/parsing/Parsers.scala | <reponame>ihji/dotty
package dotty.tools
package dotc
package parsing
import scala.collection.mutable.ListBuffer
import scala.collection.immutable.BitSet
import util.{ SourceFile, SourcePosition }
import Tokens._
import Scanners._
import MarkupParsers._
import core._
import Flags._
import Contexts._
import Names._
imp... |
ihji/dotty | tests/run/phantom-lazy-val.scala | <gh_stars>0
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
pri... |
ihji/dotty | tests/run/phantom-val-2.scala |
object Test {
def main(args: Array[String]): Unit = {
val f = new Foo
println(1)
f.foo
f.foo
assert(!f.getClass.getDeclaredFields.exists(_.getName.startsWith("foo")), "field foo not erased")
}
}
class Foo {
import Boo._
val foo = {
println("foo")
any
}
}
object Boo extends Phant... |
ihji/dotty | tests/neg/i2771.scala | <reponame>ihji/dotty
trait A { type L[X] }
trait B { type L }
trait C { type M <: A }
trait D { type M >: B }
object Test {
def test(x: C with D): Unit = {
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L has wrong kind
f(new B { type L[F[_]] = F[F] })(1) // error: F has wrong kind
}
type LB[F[_]]
t... |
ihji/dotty | tests/neg/phantom-expr.scala |
class Foo {
import Boo._
import Boo1._
type Blinky <: BooAny
type Inky <: BooAny
val blinky = Boo.boo[Blinky]
val inky = Boo.boo[Inky]
val b = true
def fooIf1 =
if (b) blinky
else "" // error
def fooIf2 =
if (b) ""
else blinky // error
def fooIf3 =
if (b) boo1
else bli... |
ihji/dotty | sbt-dotty/sbt-test/sbt-dotty/example-project/build.sbt | <reponame>ihji/dotty
scalaVersion := sys.props("plugin.scalaVersion")
libraryDependencies += ("org.scala-lang.modules" %% "scala-xml" % "1.0.1").withDottyCompat()
|
ihji/dotty | compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala | <filename>compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
package dotty.tools
package dotc
package typer
import core._
import ast._
import Scopes._, Contexts._, Constants._, Types._, Symbols._, Names._, Flags._, Decorators._
import ErrorReporting._, Annotations._, Denotations._, SymDenotations._, StdNames._, Ty... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/PhantomArgLift.scala | <reponame>ihji/dotty
package dotty.tools.dotc.transform
import dotty.tools.dotc.ast.tpd
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.NameKinds._
import dotty.tools.dotc.core.Types._
import dotty.tools.dotc.transform.TreeTransforms.{MiniPhaseTransform, TransformerInfo}
import dotty.tools.dotc.ty... |
ihji/dotty | compiler/test/dotty/Jars.scala | <gh_stars>0
package dotty
/** Jars used when compiling test, normally set from the sbt build */
object Jars {
/** Dotty library Jar */
val dottyLib: String = sys.env.get("DOTTY_LIB")
.getOrElse(Properties.dottyLib)
/** Dotty Compiler Jar */
val dottyCompiler: String = sys.env.get("DOTTY_COMPILER")
.ge... |
ihji/dotty | tests/run/phantom-decls-2.scala | <reponame>ihji/dotty<filename>tests/run/phantom-decls-2.scala
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
... |
ihji/dotty | tests/neg/phantom-bottom.scala | <filename>tests/neg/phantom-bottom.scala
class BooFunDef1 {
import Boo._
def fun0(x: Foo): x.Y = Boo.nothing
def fun1(x: Foo): x.Y = ??? // error
def fun2(x: Foo): x.Y = null // error
def fun3(x: Foo): x.Y = Boo2.nothing // error
}
class Foo {
type Y <: Boo.BooAny
}
object Boo extends Phantom {
type ... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/ElimJavaPackages.scala | package dotty.tools.dotc.transform
import dotty.tools.dotc.ast.tpd._
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Flags._
import dotty.tools.dotc.core.Types.{Type, TypeRef}
import dotty.tools.dotc.transform.TreeTransforms.{MiniPhaseTransform, TransformerInfo}
/**
* Eliminates syntactic... |
ihji/dotty | tests/run/phantom-lazy-val-2.scala |
object Test {
def main(args: Array[String]): Unit = {
val f = new Foo
println(1)
f.foo
println(2)
f.foo
// TODO: Erase
// Currently not erasing fields for lazy vals
assert(f.getClass.getDeclaredFields.exists(_.getName.startsWith("foo")), "Field foo erased. Optimized accidentally?")
... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/TailRec.scala | package dotty.tools.dotc
package transform
import ast.Trees._
import ast.{TreeTypeMap, tpd}
import core._
import Contexts.Context
import Decorators._
import DenotTransformers.DenotTransformer
import Denotations.SingleDenotation
import Symbols._
import Types._
import NameKinds.TailLabelName
import TreeTransforms.{MiniP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.