Skip to content

Allow native objects in package objects without @JSName #2401

@japgolly

Description

@japgolly

These two snippets are equivalent:

1:

package foo.bar

import scalajs.js

@js.native
object Ah extends js.Object

2:

package foo

import scalajs.js

package object bar {
  @js.native
  object Ah extends js.Object
}

Yet the second snippet fails compilation with

[error] ah.scala:7: Native JS objects inside non-native objects must have an @JSName annotation
[error]   object Ah extends js.Object

Metadata

Metadata

Assignees

Labels

enhancementFeature request (that does not concern language semantics, see "language")

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions