Skip to content

Commit 690ec2f

Browse files
committed
Fix #7700: Export forwarders of inline methods are themselves inline
1 parent bc75262 commit 690ec2f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ object Flags {
507507
val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags | Enum
508508

509509
/** Flags retained in export forwarders */
510-
val RetainedExportFlags = Given | Implicit | Extension
510+
val RetainedExportFlags = Given | Implicit | Extension | Inline
511511

512512
/** Flags that apply only to classes */
513513
val ClassOnlyFlags = Sealed | Open | Abstract.toTypeFlags

docs/docs/reference/other-new-features/export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ It is a compile-time error if a simple or renaming selector does not identify an
7070
members.
7171

7272
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.
73-
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:
73+
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:
7474

7575
- Export aliases cannot be overridden, since they are final.
7676
- Export aliases cannot override concrete members in base classes, since they are

tests/pos/i7700.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package test
2+
3+
trait Show[-A]
4+
def show(a: A): String
5+
6+
object Macros
7+
inline def (sc: StringContext) show(args: =>Any*): String = ???
8+
9+
object Show
10+
def[A] (a: A) show(given S: Show[A]): String = S.show(a)
11+
12+
export Macros.show

0 commit comments

Comments
 (0)