Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:29
    amsayk commented #10533
  • 16:16

    odersky on master

    Fix infix docs Fixes #10500 Merge pull request #10532 from … (compare)

  • 16:16
    odersky closed #10532
  • 16:16
    odersky closed #10500
  • 16:04
    LPTK commented #10536
  • 15:36
    smarter synchronize #10503
  • 15:03
    SethTisue commented #10534
  • 15:02
    SethTisue converted_to_draft #10534
  • 14:22
    romanowski commented #10462
  • 13:56
    shafqatevo starred lampepfl/dotty
  • 13:13
    romanowski synchronize #10462
  • 11:23
    LPTK commented #10534
  • 11:17
    LPTK commented #10534
  • 11:12
    sjrd synchronize #10530
  • 09:36
    odersky commented #10533
  • 06:15
    soronpo commented #10534
  • 06:14
    soronpo commented #10534
  • 04:44
    som-snytt commented #10537
  • 04:29
    sjrd commented #10537
Michael Pilquist
@mpilquist
e.g. go from type to class to classloader to jar and then try to guess where a -sources jar is based on jar url
Rob Norris
@tpolecat
Metals somehow does doc on hover so it might make sense to steal whatever it's doing.
Guillaume Martres
@smarter
it downloads source jars via bloop or coursier or something
and parses them with a custom parser to extract comments
Hanns Holger Rutz
@Sciss

does this look familiar?

[error] scala.MatchError: ThisType(TypeRef(ThisType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class desktop)),module impl),class WindowHandlerImpl)),module class MainWindowImpl$)) (of class dotty.tools.dotc.core.Types$CachedThisType)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.sourceOfSelf$1(SymDenotations.scala:1007)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.sourceModule(SymDenotations.scala:1009)
[error]     at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$apply(TypeErasure.scala:504)
[error]     at dotty.tools.dotc.core.TypeErasure.eraseInfo(TypeErasure.scala:552)
[error]     at dotty.tools.dotc.core.TypeErasure$.transformInfo(TypeErasure.scala:202)

Class at hand: https://github.com/Sciss/Desktop/blob/b2dbf2c183e69d926ba5c61329283aa166d27514/core/src/main/scala/de/sciss/desktop/impl/WindowHandlerImpl.scala

Guillaume Martres
@smarter
Yep
Fixed in master
Hanns Holger Rutz
@Sciss
you were so fast replying -- are you referring to my post?
Guillaume Martres
@smarter
yes :)
Hanns Holger Rutz
@Sciss
oh wow. fast connection I guess :-o
Guillaume Martres
@smarter
I'm using the irc bridge so there's not much to download :)
Hanns Holger Rutz
@Sciss
haha, you were probably seeing it before I got my json updated in the gitter web ui
Guillaume Martres
@smarter
actually this is supposed to be fixed in 3.0.0-M1
are you on M1?
Hanns Holger Rutz
@Sciss
... yes
is there a quick work around?
Guillaume Martres
@smarter
oh it's not the same thing then
I don't know what it is but it's related to self-types
oh you have a self-type on an object, that's bold
try removing that
Hanns Holger Rutz
@Sciss
I just had to add it because dotty says ambiguous references (e.g. I had to change title = application.name to title = me.application.name).
Guillaume Martres
@smarter
You can use nameofhteobject.foo
for a class, nameoftheclass.this.foo
Hanns Holger Rutz
@Sciss
Ok, thanks, that worked
Alvin Alexander
@alvinj
@mpilquist @tpolecat @smarter In regards to some :doc-like command in the REPL, I’m going to try something I can implement quickly to see if I like the idea in general, and if it still seems like a good idea I can look into what Metals is doing. I can’t promise quick progress, but I do want to look into this.
Philip Schwarz
@philip_schwarz_twitter
TIL about :doc :green_heart:
Hanns Holger Rutz
@Sciss
dottydoc also seems to be able to recurse infinitely (100% CPU while publishing in sbt, not terminating), jstack says
"pool-12-thread-3" #235 prio=5 os_prio=0 cpu=535423.66ms elapsed=538.05s tid=0x00007f2861200000 nid=0x4099 runnable  [0x00007f27561f4000]
   java.lang.Thread.State: RUNNABLE
    at dotty.tools.dotc.core.Types$Type.showPrefixSafely$1(Types.scala:779)
    at dotty.tools.dotc.core.Types$Type.findMember$$anonfun$1(Types.scala:783)
    at dotty.tools.dotc.core.Types$Type$$Lambda$9872/0x0000000840b7ac40.apply(Unknown Source)
    at dotty.tools.dotc.core.RecursionOverflow.explanation(TypeErrors.scala:46)
    at dotty.tools.dotc.core.RecursionOverflow.opsString$$anonfun$1(TypeErrors.scala:68)
    at dotty.tools.dotc.core.RecursionOverflow$$Lambda$9879/0x0000000841747840.apply(Unknown Source)
    at scala.collection.immutable.List.map(List.scala:246)
    at dotty.tools.dotc.core.RecursionOverflow.opsString(TypeErrors.scala:68)
    at dotty.tools.dotc.core.RecursionOverflow.produceMessage$$anonfun$1(TypeErrors.scala:77)
    at dotty.tools.dotc.core.RecursionOverflow$$Lambda$9873/0x0000000840b79040.apply(Unknown Source)
    at dotty.tools.dotc.reporting.NoExplanation.msg(Message.scala:120)
    at dotty.tools.dotc.reporting.NoExplanation.toString(Message.scala:124)
    at java.lang.String.valueOf(java.base@11.0.9/String.java:2951)
    at java.lang.StringBuilder.append(java.base@11.0.9/StringBuilder.java:168)
    at dotty.tools.dotc.Driver.doCompile(Driver.scala:56)
Guillaume Martres
@smarter
dottydoc is broken
you can switch to the new one by using useScala3doc := true
(it might also broken because it's new, but it'll be broken in different ways)
Hanns Holger Rutz
@Sciss
does that switch affect cross-builds with Scala 2, or only applies when scalaVersion is 3?
Guillaume Martres
@smarter
only scala 3
you can also turn off doc generation for scala 3 for now
Compile / doc / sources := { if (isDotty.value) Seq() else (Compile / doc / sources).value }
Hanns Holger Rutz
@Sciss
ok, yes I'm doing the latter now
does the output of useScala3doc look different? is there an online example of docs generated that way?
Guillaume Martres
@smarter
yes, but it's still in flux
Michael Pilquist
@mpilquist
Guillaume Martres
@smarter
or the issue tracker
Hanns Holger Rutz
@Sciss
nice

Seeing this now:

[error] scala.MatchError: de$sciss$audiowidgets$j$TransportCompanion$ButtonStripImpl$_setter_$de$sciss$audiowidgets$j$TransportCompanion$ButtonStripImpl$$_=$1 (of class dotty.tools.dotc.core.Names$DerivedName)
[error]     at dotty.tools.dotc.core.NameOps$.extension_fieldName(NameOps.scala:335)
[error]     at dotty.tools.dotc.transform.SymUtils$.extension_field(SymUtils.scala:163)
[error]     at dotty.tools.dotc.transform.Memoize.transformDefDef(Memoize.scala:145)
[error]     at dotty.tools.dotc.transform.MegaPhase.goDefDef(MegaPhase.scala:974)
[error]     at dotty.tools.dotc.transform.MegaPhase.goDefDef(MegaPhase.scala:975)
[error]     at dotty.tools.dotc.transform.MegaPhase.goNamed$1(MegaPhase.scala:165)
[error]     at dotty.tools.dotc.transform.MegaPhase.transformNode(MegaPhase.scala:211)
[error]     at dotty.tools.dotc.transform.MegaPhase$MiniPhase.transformFollowing(MegaPhase.scala:127)
[error]     at dotty.tools.dotc.transform.Mixin.setters$1$$anonfun$1(Mixin.scala:277)
[error]     at scala.collection.immutable.List.map(List.scala:246)
[error]     at dotty.tools.dotc.transform.Mixin.setters$2(Mixin.scala:277)

in https://github.com/Sciss/AudioWidgets/blob/220b88b3d9b0a7ee063237d9c6ddefa306a24867/core/src/main/scala/de/sciss/audiowidgets/j/Transport.scala - the only "setters" I see are the local variables in the constructor for the triplet (line 316 ff)

Guillaume Martres
@smarter
no idea what that is, a minimization will be needed
Hanns Holger Rutz
@Sciss

Has the function type syntax changed? Like I have

type CategoryLabelGenerator = (CategoryDataset,Comparable[_],Comparable[_]) => String

 object CategoryLabelGenerator {

    /** Returns the given generator. This method exists solely for the purpose to avoid typing. */
    final def apply(generator: CategoryLabelGenerator): CategoryLabelGenerator = generator

    final def apply(f: java.lang.Number => String): CategoryLabelGenerator =
      CategoryLabelGenerator { (dataset, series, category) =>    // complains
        val value = dataset.getValue(series,category)
        f(value)
      }
}

then this works in 2.13, but dotty says

[error] -- [E086] Syntax Error: /home/hhrutz/Documents/devel/scala-chart/src/main/scala/de/sciss/chart/module/CategoryLabelGenerators.scala:53:59 
[error] 53 |      CategoryLabelGenerator { (dataset, series, category) =>
[error]    |                               ^
[error]    |                               Wrong number of parameters, expected: 1

?

I also tried writing Function3, doesn't change
Guillaume Martres
@smarter
I think it's trying to call the object
since it has the same name as the type
and it's closer in scope
Hanns Holger Rutz
@Sciss
ah
sure, that must be it