Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class FieldsDsl[V](v: V):
inline def of[T]: Seq[T] = FieldsImpl.fieldsOfType[V, T](v)

extension [V](on: V):
def fields = FieldsDsl(on)
def reflectedFields = FieldsDsl(on)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ object FieldsImpl:
def isProjectField(s: Symbol) =
s.isValDef && s.tree.asInstanceOf[ValDef].tpt.tpe <:< retType
val projectsTree = Term.of(from)
val symbols = TypeTree.of[V].symbol.memberMethods.filter(isProjectField)
val symbols = TypeTree.of[V].symbol.fields.filter(isProjectField)
val selects = symbols.map(Select(projectsTree, _).asExprOf[T])
'{ println(${Expr(retType.show)}); ${Varargs(selects)} }
2 changes: 1 addition & 1 deletion community-build/src/scala/dotty/communitybuild/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object Main:
case "publish" :: name :: Nil =>
case "doc" :: "all" :: destStr :: Nil =>
val dest = Paths.get(destStr)
Seq("rm", "-rf", "destStr").!
Seq("rm", "-rf", destStr).!
Files.createDirectory(dest)
val (toRun, ignored) =
allProjects.partition(_.docCommand != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,6 @@ object projects:

end projects

def allProjects = projects.fields.of[CommunityProject].sortBy(_.project)
def allProjects = projects.reflectedFields.of[CommunityProject].sortBy(_.project)

lazy val projectMap = allProjects.map(p => p.project -> p).toMap