Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:20

    bishabosha on master

    add docs about deprecation of e… Merge pull request #11169 from … (compare)

  • 00:20
    bishabosha closed #11169
  • 00:18
    smarter labeled #11173
  • 00:18
    smarter labeled #11173
  • 00:15
    flomebul edited #11172
  • 00:14
    flomebul edited #11172
  • 00:14
    marcinzh edited #11173
  • 00:09
    marcinzh edited #11173
  • 00:09
    marcinzh edited #11173
  • 00:04
    marcinzh labeled #11173
  • 00:04
    marcinzh labeled #11173
  • 00:04
    marcinzh opened #11173
  • Jan 19 23:52
    flomebul edited #11172
  • Jan 19 23:51
    flomebul opened #11172
  • Jan 19 23:30
  • Jan 19 23:29
    flomebul commented #11171
  • Jan 19 22:29
    Swalkyn commented #11135
  • Jan 19 22:28
    Swalkyn commented #11135
  • Jan 19 20:47
    michelou commented #11171
  • Jan 19 20:22
    michelou commented #11171
Felix Mulder
@felixmulder
@sirinath - no, the README was outdated and the featurelist still exists on dotty.epfl.ch (i.e. duplicated) and this month in dotty hasn't been completed for November
Suminda Sirinath Salpitikorala Dharmasena
@sirinath
The link for this month in dotty is no longer available through the website
Wny way can it be made weekly? One a month is too far apart.
nafg
@nafg
@sirinath are you subscribed to the github repo?
Matthew Pocock
@drdozer
@smarter are you based in EPFL?
Dmitry Petrashko
@DarkDimius
Matthew Pocock
@drdozer
cheers
Turns out flights from Newcaslte to Geneve are about £50 return -- I'm tempted to pop over after Christmas
Guillaume Martres
@smarter
@drdozer yup
Matthew Pocock
@drdozer
cool :D
is there anything going on in your group Jan-April that I could use as an excuse to come over and see you guys?
Suminda Sirinath Salpitikorala Dharmasena
@sirinath
@nafg I not a watcher but I check progress regularly.
Miron Aseev
@maseev
Is there any way I can quickly recompile dotty source so I would be able to test new feature in the REPL or by compiling some source file? Calling compile or package tasks from sbt doesn't make any difference. clean and partest take too much time :(
Dmitry Petrashko
@DarkDimius
@maseev the /bin/dotc script that is in the repo should use sbt to incrementally recompile only changed files. It doesn't help much if you change fundamentals, as all dependencies will also need recompilation.
Guillaume Martres
@smarter
@maseev What do you mean "doesn't make any difference"?
@maseev compile in sbt will compile with sbt, if you want to run the compiler, use run somefile.scala
To run the repl from sbt you can do run-main dotty.tools.dotc.repl.Main (we should get a shorter alias for this soon)
Miron Aseev
@maseev
Why can't I use dotr from the /bin folder?
Guillaume Martres
@smarter
you can, but if you changed something it will launch sbt to recompile and package stuff
and launching sbt is slooooowww
I've seen activity on the sbt repository around the sbt server so this may get better in the future
Vlad Uspensky
@vuspenskiy
Hi, I've seen that "literal singleton types" are already implemented in dotty, val r: 42.type = 42 should compile then, right? Or syntax is different?
nafg
@nafg
@vuspenskiy I think they decided to go without the .type
Vlad Uspensky
@vuspenskiy
Thank you, that is right, @xeno-by suggested that too.

Ok, I actually wanted to implement some case from Idris and wanted to use dotty for that, are tagged types not working intentionally, or is there a chance it'll work?

object tagging {
    trait Tagged[+V, +Tag]
  }
  type @@[+V, +Tag] = V with tagging.Tagged[V, Tag]

  type TaggedLong[+Tag] = Long @@ Tag
  object TaggedLong {
    def apply[Tag](value: Long) = value.asInstanceOf[TaggedLong[Tag]]
  }
  TaggedLong[String](12L)

currently failing with java.lang.ClassCastException: java.lang.Long cannot be cast to vu.dt.Main$tagging$Tagged

Dmitry Petrashko
@DarkDimius
I don't think that example you're proposing would work dirrectly.
Long is a final type and you cant retroactively tag it, without introducing some kind of wrapper.
In Dotty, all types currently are currently nominal, meaning that in order for value.asInstanceOf[TaggedLong[_]] to succeed, the definition of the runtime value should explicitly inherit Tagged
What you could try instead is case class Tagged[+V, +Tag](value: V), where you would be able to wrap an arbitrary type with a tag.
Dmitry Petrashko
@DarkDimius
If it proves to be an issue, you could consider making it a value class, which would help to remove wrapper in many cases.
case class Tagged[+V, +Tag](value: V) extends AnyVal
Guillaume Martres
@smarter
He's relying on the implementation detail that V with tagging.Tagged[V, Tag] gets erased to V and not to Tagged[V, Tag], which apparently isn't true in dotty
The advantage of this is that primitives get boxed but everything else doesn't
Dmitry Petrashko
@DarkDimius
It gets erazed into Tagged, as it's a more precise type than Object(which is erasure of V).
Guillaume Martres
@smarter
well, that's not scalac behavior
Dmitry Petrashko
@DarkDimius

Well, scalac does not have proper intersection types, while dotty does...
Our & types are supposed to be unordered.

https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/core/TypeErasure.scala#L325

Guillaume Martres
@smarter
Vlad Uspensky
@vuspenskiy
@DarkDimius type tags are nice to retroactively add type tag to already existing types (not necessarily primitive, as in case with AnyVal). AnyVal solution or close will work for me, but type tags might still be used, as they are implemented in scalaz. I actually remember me using it for one project, where I was needed to pass information that it is not just Long number, but special Long type, but without changing the whole call stack with new type, that might be the use-case for tagging too.
Vlad Uspensky
@vuspenskiy

BTW, this case failing is already reported?

object Fail {

  case class So[+T]()

  def main(args: Array[String]): Unit = {
    So[Int]() match {
      case p@So[_] => Console.println("Yep")
      case _       => Console.println("Nope")
    }
  }
}

exception occurred while typechecking /path/to/Src.scala
exception occurred while compiling /path/to/Src.scala

Works well if underscore in pattern matching is replaced with specific type.

Jentsch
@Jentsch

Hi, I might found a bug in Dotties REPL and Type aliases.
The example below fails within the REPL with "not found: type Infix".

type Infix = Tuple;
def x: String Infix String = ("", "")

Declaring a new class with two type parametern result in no error. Also compiling a scala File with the same content is ok. Using the prefix notation Infix[String, String] yields also no errors.
Should I open a issue on GitHub?

Reto Habluetzel
@rethab
Shouldn't this work? (At least the error message is a tad confusing :D)
scala> def id(x: 1): 1 = x
id: (x: Int(1))Int(1)
scala> id(1)
-- [E007] Type Mismatch Error: <console> -----------------------------------
6 |id(1)
  |   ^
  |   found:    Int(1)
  |   required: Int(1)
  |
scala>
Alex Cruise
@acruise
Is there a CLA for dotty distinct from the Scala one?
I signed the Scala one many years ago
CONTRIBUTING.md says "Make sure you have signed the Scala CLA, if not, sign it." so I'm prrrobably good
Guillaume Martres
@smarter
@acruise Yes, it's just the scala cla
Alex Cruise
@acruise
Cool, thanks!
Guillaume Martres
@smarter
@vuspenskiy, @Jentsch, @rethab : These all sounds like bugs, please report them on https://github.com/lampepfl/dotty/issues
Reto Habluetzel
@rethab
thx. I will
Alex Cruise
@acruise
Sorry for the noob question... I'm working on #1265; what's the easiest way to check whether --verbose or --show-diff is actually in effect, without running the whole test suite twice? :)
I guess I could change one of the .check files