Skip to content

Reflective calls fail on compile. #1379

Closed
@nicolasstucki

Description

@nicolasstucki
scala> object Foo {
     |   val bar = new Object {
     |     def baz = 1
     |   }
     | 
     |   bar.baz
     | }
warning: there was one feature warning; re-run with -feature for details
defined object Foo

scala> Foo.bar.baz
warning: there was one feature warning; re-run with -feature for details
res0: Int = 1
dotty> object Foo {
         val bar = new Object {
           def baz = 1
         }

         bar.baz
       } 
      ^
  bar.baz
<console>:9: error: baz is not a member of Object(line2$object.$iw.$iw.Foo.bar)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions