WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

Assuming that tpe is the TypeRepr for the case class, field symbols can be accessed using tpe.typeSymbol.caseFields. Then, to obtain the TypeRepr for a field, you can use .memberType, as follows:

tpe.typeSymbol.caseFields.map { fieldSymbol =>
  val fieldTpe = tpe.memberType(fieldSymbol)
  ...
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@adamw

This comment has been hidden.

@bishabosha

This comment has been hidden.

@adamw

This comment has been hidden.

Answer selected by adamw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants