These are chat archives for typelevel/scala

22nd
Nov 2017
Odomontois
@Odomontois
Nov 22 2017 09:08
Is there a way to use scalaOrganization in ThisBuild := "org.typelevel" in sbt 1.0.x?
Right now sbt is trying to resolve compiler for build definition and emitting
org.typelevel:scala-compiler:2.12.3:
[error]         not found:
I'm referencing this issue https://stackoverflow.com/a/11957575/210905
Guillaume Martres
@smarter
Nov 22 2017 17:08
Is it me or is there no link from https://typelevel.org/ to https://typelevel.org/scala/ ?
Also where do I find the release notes
Ah, Google led me to https://github.com/typelevel/scala/blob/typelevel-readme/notes/typelevel-4.md but is it linked to from the homepage somewhere ?
Rob Norris
@tpolecat
Nov 22 2017 17:29
The link from https://typelevel.org/scala/ is under "Typelevel Scala Releases"
I have also had trouble finding it before. Could be more prominent somehow.
Miles Sabin
@milessabin
Nov 22 2017 18:02
Hmm ... yes, that text works well on github, but less well when extracted out as a micro site.
Guillaume Martres
@smarter
Nov 22 2017 18:40
Any particular reason why valueOf[this.type] does not work ?
Miles Sabin
@milessabin
Nov 22 2017 18:41
It's a bug, fixed in ... hang on a mo' ...
Hmm ... actually, not sure. There have been a number of bug fixes since the TLS-4 release: https://github.com/typelevel/scala/issues?q=is%3Aissue+is%3Aclosed+project%3Atypelevel%2Fscala%2F1.
I think it's reasonably likely that a problem of that sort has been fixed, but I'd need to check.
The scala/scala PR is up to date if you want to try the latest version, which corresponds to the SIP.
Miles Sabin
@milessabin
Nov 22 2017 18:51
OK, looks like this is a bug in the current version,
object Test {
  valueOf[this.type]
}
sip23-valueof-this.scala:2: error: No singleton value available for Test.type.
  valueOf[this.type]
         ^
one error found
Thanks for the report ... I'll fix.
Did you have a different example?
Guillaume Martres
@smarter
Nov 22 2017 18:52
No, that's what I had in mind :)
Well, I guess it should also be checked in a class and not just an object
Miles Sabin
@milessabin
Nov 22 2017 18:53
Sure.
Guillaume Martres
@smarter
Nov 22 2017 18:54
A fun thing would be to check if self types work too
e.g. class A { outerSelf => class B { valueOf[outerSelf.type] } }
Miles Sabin
@milessabin
Nov 22 2017 18:56
Indeed.
Miles Sabin
@milessabin
Nov 22 2017 19:06
@smarter these now all work as expected,
object Test1 {
  valueOf[this.type]
}

class Test2 {
  valueOf[this.type]
}

class Test3 { self =>
  valueOf[self.type]
}
Your example looks like this after typer,
class A extends scala.AnyRef { outerSelf: A => 
  def <init>(): A = {
    A.super.<init>();
    ()
  };
  class B extends scala.AnyRef {
    def <init>(): A.this.B = {
      B.super.<init>();
      ()
    };
    scala.Predef.valueOf[A.this.type](new ValueOf[A.this.type](A.this))
  }
}
Guillaume Martres
@smarter
Nov 22 2017 19:27
Cool!
Miles Sabin
@milessabin
Nov 22 2017 19:27
Just running partest ... will push to the PR branch shortly.
Miles Sabin
@milessabin
Nov 22 2017 19:54
@smarter pushed.