Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected type tag TYPEBOUNDS at address Addr(298) #356

Closed
adpi2 opened this issue Oct 4, 2023 · 5 comments
Closed

Unexpected type tag TYPEBOUNDS at address Addr(298) #356

adpi2 opened this issue Oct 4, 2023 · 5 comments

Comments

@adpi2
Copy link
Member

adpi2 commented Oct 4, 2023

package example

class A {
  def m(x: Int): String ?=> String = ???
  def m(): (Int, String) ?=> Int = ???
  def m(x: String): Int ?=> String ?=> String = ???
  def mbis: ? ?=> String = ???
}
tastyquery.Exceptions$TastyFormatException: Unexpected type tag TYPEBOUNDS at address Addr(298) in file /tmp/scala-debug-adapter7599745288498851691/classes/example/A.tasty
    at tastyquery.reader.tasties.TreeUnpickler.readTypeMappable(TreeUnpickler.scala:1335)
    at tastyquery.reader.tasties.TreeUnpickler.readNonEmptyPrefix(TreeUnpickler.scala:1165)
    at tastyquery.reader.tasties.TreeUnpickler.doReadTypeTree(TreeUnpickler.scala:1595)
    at tastyquery.reader.tasties.TreeUnpickler.readTypeTree(TreeUnpickler.scala:1481)
    at tastyquery.reader.tasties.TreeUnpickler.doReadValOrDefDef(TreeUnpickler.scala:736)
    at tastyquery.reader.tasties.TreeUnpickler.readValOrDefDef(TreeUnpickler.scala:725)
    at tastyquery.reader.tasties.TreeUnpickler.readParams(TreeUnpickler.scala:706)
    at tastyquery.reader.tasties.TreeUnpickler.readAllParams(TreeUnpickler.scala:689)
    at tastyquery.reader.tasties.TreeUnpickler.doReadValOrDefDef(TreeUnpickler.scala:735)
    at tastyquery.reader.tasties.TreeUnpickler.readValOrDefDef(TreeUnpickler.scala:725)
    at tastyquery.reader.tasties.TreeUnpickler.doReadStat(TreeUnpickler.scala:504)
    at tastyquery.reader.tasties.TreeUnpickler.readStat(TreeUnpickler.scala:449)
    at tastyquery.reader.tasties.TreeUnpickler.readStats$$anonfun$1(TreeUnpickler.scala:446)
    at dotty.tools.tasty.TastyReader.until(TastyReader.scala:125)
    at tastyquery.reader.tasties.TreeUnpickler.readStats(TreeUnpickler.scala:446)
    at tastyquery.reader.tasties.TreeUnpickler.doReadTerm(TreeUnpickler.scala:973)
@sjrd
Copy link
Contributor

sjrd commented Oct 4, 2023

So this one is really a dotc issue: scala/scala3#18649

@bishabosha
Copy link
Member

Shouldn't we handle it anyway? seems like dotty doesnt crash

@bishabosha
Copy link
Member

If I compile A first, and then read it from the classpath, this is the error for calling mbis:

object Test:
  def test =
    val a = example.A()
    given String = "abc"
    given Int = 1
    a.m(23)
    a.m()
    a.m("abc")
    a.mbis

error:

Compiling project (Scala 3.3.1, JVM)
[error] ./bar.scala:9:11
[error] No given instance of type ?1.scala$ContextFunction1$$T1 was found for parameter of (?) ?=> String
[error] 
[error] where:    ?1 is an unknown value of type (?) ?=> String
[error]     a.mbis
[error]           ^
Error compiling project (Scala 3.3.1, JVM)

@sjrd
Copy link
Contributor

sjrd commented Oct 5, 2023

No I really don't think we can or want to handle this. It's fundamentally invalid. It's like declaring a val x: ? = .... That makes no sense.

@sjrd
Copy link
Contributor

sjrd commented Oct 13, 2023

The issue was fixed upstream.

@sjrd sjrd closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants