Skip to content

Commit 6e7f141

Browse files
committed
Remove the -Yno-inline setting.
This setting forks the binary ecosystem and the language. It was used by Scala3doc, but that is incorrect, as inlining can change the inferred result types and therefore the public APIs (when it doesn't simply prevent something from compiling).
1 parent c359617 commit 6e7f141

File tree

6 files changed

+2
-8
lines changed

6 files changed

+2
-8
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
160160
val Yscala2Unpickler: Setting[String] = StringSetting("-Yscala2-unpickler", "", "Control where we may get Scala 2 symbols from. This is either \"always\", \"never\", or a classpath.", "always")
161161

162162
val YnoImports: Setting[Boolean] = BooleanSetting("-Yno-imports", "Compile without importing scala.*, java.lang.*, or Predef.")
163-
val YnoInline: Setting[Boolean] = BooleanSetting("-Yno-inline", "Suppress inlining.")
164163
val YnoGenericSig: Setting[Boolean] = BooleanSetting("-Yno-generic-signatures", "Suppress generation of generic signatures for Java.")
165164
val YnoPredef: Setting[Boolean] = BooleanSetting("-Yno-predef", "Compile without importing Predef.")
166165
val Yskip: Setting[List[String]] = PhasesSetting("-Yskip", "Skip")

compiler/src/dotty/tools/dotc/transform/Memoize.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
129129
cpy.installAfter(thisPhase)
130130
}
131131

132-
val NoFieldNeeded = Lazy | Deferred | JavaDefined | (if (ctx.settings.YnoInline.value) EmptyFlags else Inline)
132+
val NoFieldNeeded = Lazy | Deferred | JavaDefined | Inline
133133

134134
def erasedBottomTree(sym: Symbol) =
135135
if (sym eq defn.NothingClass) Throw(nullLiteral)

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,7 @@ class Typer extends Namer
32833283
}
32843284
else if (methPart(tree).symbol.isAllOf(Inline | Deferred) && !Inliner.inInlineMethod) then
32853285
errorTree(tree, i"Deferred inline ${methPart(tree).symbol.showLocated} cannot be invoked")
3286-
else if (Inliner.isInlineable(tree) &&
3287-
!ctx.settings.YnoInline.value &&
3288-
!suppressInline) {
3286+
else if (Inliner.isInlineable(tree) && !suppressInline) {
32893287
tree.tpe <:< wildApprox(pt)
32903288
val errorCount = ctx.reporter.errorCount
32913289
val meth = methPart(tree).symbol

doc-tool/src/dotty/tools/dottydoc/DocDriver.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class DocDriver extends Driver {
2626

2727
ctx.setSettings(summary.sstate)
2828
ctx.setSetting(ctx.settings.YcookComments, true)
29-
ctx.setSetting(ctx.settings.YnoInline, true)
3029
ctx.setProperty(ContextDoc, new ContextDottydoc)
3130

3231
val fileNames = CompilerCommand.checkUsage(summary, sourcesRequired)(using ctx)

doc-tool/test/dotty/tools/dottydoc/DottyDocTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ trait DottyDocTest extends MessageRendering {
3232
ctx.setSetting(ctx.settings.language, List("Scala2"))
3333
ctx.setSetting(ctx.settings.YcookComments, true)
3434
ctx.setSetting(ctx.settings.Ycheck, "all" :: Nil)
35-
ctx.setSetting(ctx.settings.YnoInline, true)
3635
ctx.setSetting(ctx.settings.wikiSyntax, true)
3736
ctx.setProperty(ContextDoc, new ContextDottydoc)
3837
ctx.setSetting(

doc-tool/test/dotty/tools/dottydoc/MarkdownTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
1818
val ctx = base.initialCtx.fresh
1919
ctx.setSetting(ctx.settings.language, List("Scala2"))
2020
ctx.setSetting(ctx.settings.YcookComments, true)
21-
ctx.setSetting(ctx.settings.YnoInline, true)
2221
ctx.setSetting(ctx.settings.Ycheck, "all" :: Nil)
2322
// No wiki syntax!
2423
ctx.setSetting(ctx.settings.wikiSyntax, false)

0 commit comments

Comments
 (0)