Skip to content

Fix Java TASTy of scala module class references #19806

Closed
@bishabosha

Description

@bishabosha

For some definitions

package p

object Module
public class J {
  public p.Module$ module() {
    return p.Module$.MODULE$;
  }
}

When the tree for J reaches TASTy (using -Yjava-tasty -Yjava-tasty-output foo.jar), this looks like

    87:       DEFDEF(12) 16 [module]
    90:         EMPTYCLAUSE
    91:         SELECTtpt 17 [Module$]
    93:           SHAREDtype 3
    95:         ELIDED
    96:           TYPEREF 19 [Module[ModuleClass]]
    98:             SHAREDtype 3
   100:         STATIC

really, tree 91 should be SELECTtpt 19 [Module[ModuleClass]]. This relies on the compiler (aka all TASTy clients) intrinsically knowing how to resolve Module$ when the definition is actually Module[ModuleClass]

Originally posted by @bishabosha in #19773 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions