diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index 1ac658387520..e0d60cd5d7f5 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -507,7 +507,7 @@ object Flags { val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags | Enum /** Flags retained in export forwarders */ - val RetainedExportFlags = Given | Implicit | Extension + val RetainedExportFlags = Given | Implicit | Extension | Inline /** Flags that apply only to classes */ val ClassOnlyFlags = Sealed | Open | Abstract.toTypeFlags diff --git a/docs/docs/reference/other-new-features/export.md b/docs/docs/reference/other-new-features/export.md index 5340ca45baa2..20c56ecc50be 100644 --- a/docs/docs/reference/other-new-features/export.md +++ b/docs/docs/reference/other-new-features/export.md @@ -70,7 +70,7 @@ It is a compile-time error if a simple or renaming selector does not identify an members. Type members are aliased by type definitions, and term members are aliased by method definitions. Export aliases copy the type and value parameters of the members they refer to. -Export aliases are always `final`. Aliases of given instances are again defined as givens (and aliases of old-style implicits are `implicit`). There are no other modifiers that can be given to an alias. This has the following consequences for overriding: +Export aliases are always `final`. Aliases of given instances are again defined as givens (and aliases of old-style implicits are `implicit`). Aliases of inline methods or values are again defined `inline`. There are no other modifiers that can be given to an alias. This has the following consequences for overriding: - Export aliases cannot be overridden, since they are final. - Export aliases cannot override concrete members in base classes, since they are @@ -119,7 +119,6 @@ class B { val c: Int } object a { val b = new B } export a._ export b._ -} ``` Is the `export b._` clause legal? If yes, what does it export? Is it equivalent to `export a.b._`? What about if we swap the last two clauses? ``` diff --git a/tests/pos/i7700.scala b/tests/pos/i7700.scala new file mode 100644 index 000000000000..913285822c31 --- /dev/null +++ b/tests/pos/i7700.scala @@ -0,0 +1,12 @@ +package test + +trait Show[-A] + def show(a: A): String + +object Macros + inline def (sc: StringContext) show(args: =>Any*): String = ??? + +object Show + def[A] (a: A) show(given S: Show[A]): String = S.show(a) + + export Macros.show \ No newline at end of file