-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make main methods invisible #11546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make main methods invisible #11546
Changes from 3 commits
09b7746
789ceb1
4f2e6a4
b4dfb6b
a7a97b4
54495b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -585,11 +585,9 @@ class TreeUnpickler(reader: TastyReader, | |
val annots = annotFns.map(_(sym.owner)) | ||
sym.annotations = annots | ||
if sym.isOpaqueAlias then sym.setFlag(Deferred) | ||
val isSyntheticBeanAccessor = flags.isAllOf(Method | Synthetic) && | ||
annots.exists(a => a.matches(defn.BeanPropertyAnnot) || a.matches(defn.BooleanBeanPropertyAnnot)) | ||
val isScala2MacroDefinedInScala3 = flags.is(Macro, butNot = Inline) && flags.is(Erased) | ||
ctx.owner match { | ||
case cls: ClassSymbol if (!isScala2MacroDefinedInScala3 || cls == defn.StringContextClass) && !isSyntheticBeanAccessor => | ||
case cls: ClassSymbol if !isScala2MacroDefinedInScala3 || cls == defn.StringContextClass => | ||
// Enter all members of classes that are not Scala 2 macros or synthetic bean accessors. | ||
// | ||
// For `StringContext`, enter `s`, `f` and `raw` | ||
|
@@ -670,6 +668,7 @@ class TreeUnpickler(reader: TastyReader, | |
case PARAMalias => addFlag(SuperParamAlias) | ||
case EXPORTED => addFlag(Exported) | ||
case OPEN => addFlag(Open) | ||
case INVISIBLE => addFlag(Invisible) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flag should be visible in tasty-reflect too /cc @nicolasstucki |
||
case TRANSPARENT => addFlag(Transparent) | ||
case INFIX => addFlag(Infix) | ||
case PRIVATEqualified => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,7 +211,8 @@ Standard-Section: "ASTs" TopLevelStat* | |
PARAMsetter -- The setter part `x_=` of a var parameter `x` which itself is pickled as a PARAM | ||
PARAMalias -- Parameter is alias of a superclass parameter | ||
EXPORTED -- An export forwarder | ||
OPEN -- an open class | ||
OPEN | ||
INVISIBLE -- an open class | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment on wrong line (and inconsistently indented). |
||
Annotation | ||
|
||
Variance = STABLE -- invariant | ||
|
@@ -284,7 +285,7 @@ object TastyFormat { | |
* compatibility, but remains backwards compatible, with all | ||
* preceeding `MinorVersion`. | ||
*/ | ||
final val MinorVersion: Int = 0 | ||
final val MinorVersion: Int = 1 | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/**Natural Number. The `ExperimentalVersion` allows for | ||
* experimentation with changes to TASTy without committing | ||
|
@@ -474,6 +475,7 @@ object TastyFormat { | |
final val INFIX = 43 | ||
final val EMPTYCLAUSE = 44 | ||
final val SPLITCLAUSE = 45 | ||
final val INVISIBLE = 46 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
firstSimpleTreeTag <= tag && tag <= SPLITCLAUSE || presumably that should be replaced with |
||
|
||
// Cat. 2: tag Nat | ||
|
||
|
@@ -636,6 +638,7 @@ object TastyFormat { | |
| PARAMalias | ||
| EXPORTED | ||
| OPEN | ||
| INVISIBLE | ||
| ANNOTATION | ||
| PRIVATEqualified | ||
| PROTECTEDqualified => true | ||
|
@@ -698,6 +701,7 @@ object TastyFormat { | |
case PARAMsetter => "PARAMsetter" | ||
case EXPORTED => "EXPORTED" | ||
case OPEN => "OPEN" | ||
case INVISIBLE => "INVISIBLE" | ||
case PARAMalias => "PARAMalias" | ||
case EMPTYCLAUSE => "EMPTYCLAUSE" | ||
case SPLITCLAUSE => "SPLITCLAUSE" | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package foo: | ||
@main def main(): Unit = println("Hello, World!") | ||
|
||
@main def List(): Unit = println("List") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.