Skip to content
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

reflection has own idea of what is a val #7575

Closed
scabug opened this issue Jun 13, 2013 · 4 comments
Closed

reflection has own idea of what is a val #7575

scabug opened this issue Jun 13, 2013 · 4 comments

Comments

@scabug
Copy link

scabug commented Jun 13, 2013

I would expect "filterNot (_.isVal)" to filter out all these things which present themselves as vals.

scala> (typeOf[scala.reflect.api.Universe].members filterNot (_.isVal) map (_.defString) filter (_ startsWith "val ")).toList.sorted >
warning: there were 1 feature warning(s); re-run with -feature for details
val Alternative: Trees.this.AlternativeExtractor
val Annotated: Trees.this.AnnotatedExtractor
val AnnotatedType: Types.this.AnnotatedTypeExtractor
val Annotation: Annotations.this.AnnotationExtractor
val AppliedTypeTree: Trees.this.AppliedTypeTreeExtractor
val Apply: Trees.this.ApplyExtractor
val ArrayArgument: Annotations.this.ArrayArgumentExtractor
val Assign: Trees.this.AssignExtractor
val AssignOrNamedArg: Trees.this.AssignOrNamedArgExtractor
val Bind: Trees.this.BindExtractor
val Block: Trees.this.BlockExtractor
val BoundedWildcardType: Types.this.BoundedWildcardTypeExtractor
val CaseDef: Trees.this.CaseDefExtractor
val ClassDef: Trees.this.ClassDefExtractor
val ClassInfoType: Types.this.ClassInfoTypeExtractor
val CompoundTypeTree: Trees.this.CompoundTypeTreeExtractor
val Constant: Constants.this.ConstantExtractor
val ConstantType: Types.this.ConstantTypeExtractor
val DefDef: Trees.this.DefDefExtractor
val EmptyTree: Trees.this.Tree
val ExistentialType: Types.this.ExistentialTypeExtractor
val ExistentialTypeTree: Trees.this.ExistentialTypeTreeExtractor
val Flag: FlagSets.this.FlagValues
val Function: Trees.this.FunctionExtractor
val Ident: Trees.this.IdentExtractor
val If: Trees.this.IfExtractor
val Import: Trees.this.ImportExtractor
val ImportSelector: Trees.this.ImportSelectorExtractor
val LabelDef: Trees.this.LabelDefExtractor
val Literal: Trees.this.LiteralExtractor
val LiteralArgument: Annotations.this.LiteralArgumentExtractor
val Match: Trees.this.MatchExtractor
val MethodType: Types.this.MethodTypeExtractor
val Modifiers: Trees.this.ModifiersExtractor
val ModuleDef: Trees.this.ModuleDefExtractor
val NestedArgument: Annotations.this.NestedArgumentExtractor
val New: Trees.this.NewExtractor
val NoFlags: FlagSets.this.FlagSet
val NoPosition: Positions.this.Position
val NoPrefix: Types.this.Type
val NoSymbol: Symbols.this.Symbol
val NoType: Types.this.Type
val NullaryMethodType: Types.this.NullaryMethodTypeExtractor
val PackageDef: Trees.this.PackageDefExtractor
val PolyType: Types.this.PolyTypeExtractor
val RefTree: Trees.this.RefTreeExtractor
val ReferenceToBoxed: Trees.this.ReferenceToBoxedExtractor
val RefinedType: Types.this.RefinedTypeExtractor
val Return: Trees.this.ReturnExtractor
val Select: Trees.this.SelectExtractor
val SelectFromTypeTree: Trees.this.SelectFromTypeTreeExtractor
val SingleType: Types.this.SingleTypeExtractor
val SingletonTypeTree: Trees.this.SingletonTypeTreeExtractor
val Star: Trees.this.StarExtractor
val Super: Trees.this.SuperExtractor
val SuperType: Types.this.SuperTypeExtractor
val Template: Trees.this.TemplateExtractor
val TermName: Names.this.TermNameExtractor
val This: Trees.this.ThisExtractor
val ThisType: Types.this.ThisTypeExtractor
val Throw: Trees.this.ThrowExtractor
val Try: Trees.this.TryExtractor
val TypeApply: Trees.this.TypeApplyExtractor
val TypeBounds: Types.this.TypeBoundsExtractor
val TypeBoundsTree: Trees.this.TypeBoundsTreeExtractor
val TypeDef: Trees.this.TypeDefExtractor
val TypeName: Names.this.TypeNameExtractor
val TypeRef: Types.this.TypeRefExtractor
val TypeTree: Trees.this.TypeTreeExtractor
val Typed: Trees.this.TypedExtractor
val UnApply: Trees.this.UnApplyExtractor
val ValDef: Trees.this.ValDefExtractor
val WildcardType: Types.this.Type
val build: BuildUtils.this.BuildApi
val definitions: StandardDefinitions.this.DefinitionsApi
val emptyValDef: Trees.this.ValDef
val nme: StandardNames.this.TermNamesApi
val pendingSuperCall: Trees.this.Apply
val rootMirror: Mirrors.this.Mirror
val tpnme: StandardNames.this.TypeNamesApi
val treeCopy: Trees.this.TreeCopier
@scabug
Copy link
Author

scabug commented Jun 13, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7575?orig=1
Reporter: @paulp
See #8220, #8063

@scabug
Copy link
Author

scabug commented Jun 13, 2013

@paulp said:
Interestingly if I filter out (_.isDeferred), there is still one which gets through, which must be another bug somewhere.

scala> (typeOf[scala.reflect.api.Universe].members filterNot (_.isVal) filterNot (_.isDeferred) map (_.defString) filter (_ startsWith "val ")).toList.sorted >
val treeCopy: Trees.this.TreeCopier

@scabug
Copy link
Author

scabug commented Feb 1, 2014

@xeno-by said (edited on Feb 1, 2014 2:03:41 AM UTC):
While classifying symbols for #8220 it would be nice to think about this behavior once again. Do we want abstract methods generated for vals to be treated as vals? Do we not? Or maybe we should eschew this classification altogether and come up with something better (i.e. classes - objects - fields - methods - type members or even subdivide methods into methods - getters - setters)?

@SethTisue
Copy link
Member

reopen if this is still applicable in current Scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants