forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of the fix for scala#15413 Part of the fix for scala#16983
- Loading branch information
1 parent
847eccc
commit ab2d6ec
Showing
21 changed files
with
507 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
compiler/src/dotty/tools/dotc/transform/BinaryAPIAnnotations.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package dotty.tools.dotc.transform | ||
|
||
import dotty.tools.dotc.core.Contexts.* | ||
import dotty.tools.dotc.core.DenotTransformers.SymTransformer | ||
import dotty.tools.dotc.core.Flags.* | ||
import dotty.tools.dotc.core.Symbols.NoSymbol | ||
import dotty.tools.dotc.core.SymDenotations.SymDenotation | ||
import dotty.tools.dotc.transform.MegaPhase.MiniPhase | ||
|
||
/** Makes @binaryAPI definitions public */ | ||
class BinaryAPIAnnotations extends MiniPhase with SymTransformer: | ||
|
||
override def phaseName: String = BinaryAPIAnnotations.name | ||
override def description: String = BinaryAPIAnnotations.description | ||
|
||
def transformSym(d: SymDenotation)(using Context): SymDenotation = { | ||
if d.isBinaryAPI then | ||
d.resetFlag(Protected) | ||
d.setPrivateWithin(NoSymbol) | ||
d | ||
} | ||
|
||
object BinaryAPIAnnotations: | ||
val name: String = "binaryAPIAnnotations" | ||
val description: String = "makes @binaryAPI definitions public" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.