Merge pull request #8168 from Duhemm/mduhem/name-dash

Support minus sign in project names
This commit is contained in:
eugene yokota 2025-06-26 21:37:25 -04:00 committed by GitHub
commit 3342752e6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@ import dotty.tools.dotc.ast
import dotty.tools.dotc.ast.tpd
import dotty.tools.dotc.CompilationUnit
import dotty.tools.dotc.core.Contexts.{ atPhase, Context }
import dotty.tools.dotc.core.{ Flags, Names, Phases, Symbols, Types }
import dotty.tools.dotc.core.{ Flags, NameKinds, Names, Phases, Symbols, Types }
import dotty.tools.dotc.Driver
import dotty.tools.dotc.Run
import dotty.tools.dotc.util.SourceFile
@ -391,11 +391,10 @@ object Eval:
case tpd.ValDef(name, tpt, _)
if isTopLevelModule(tree.symbol.owner) && isAcceptableType(tpt.tpe) =>
vals ::= name.mangledString
case tpd.ValDef(name, tpt, _) if name.mangledString.contains("$lzy") =>
val str = name.mangledString
val methodName = str.take(str.indexOf("$"))
case tpd.ValDef(name, tpt, _) if name.is(NameKinds.LazyLocalName) =>
val methodName = name.underlying
val m = tree.symbol.owner.requiredMethod(methodName)
if isAcceptableType(m.info) then vals ::= methodName
if isAcceptableType(m.info) then vals ::= methodName.mangledString
case t: tpd.Template => this((), t.body)
case t: tpd.PackageDef => this((), t.stats)
case t: tpd.TypeDef => this((), t.rhs)

View File

@ -0,0 +1 @@
lazy val `a-funky-name` = project

View File

@ -0,0 +1 @@
> name