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

ExplicitResultTypes crashes on java paths #674

Closed
olafurpg opened this issue Apr 4, 2018 · 1 comment
Closed

ExplicitResultTypes crashes on java paths #674

olafurpg opened this issue Apr 4, 2018 · 1 comment
Labels

Comments

@olafurpg
Copy link
Contributor

olafurpg commented Apr 4, 2018

scala/test/explicitResultTypes/ExplicitResultTypesBase.scala:55:16: error: java.lang.ClassCastException: scala.meta.Type$Select$TypeSelectImpl cannot be cast to scala.meta.Term$Ref
	at scalafix.internal.util.TypeSyntax.loop$2(TypeSyntax.scala:183)
	at scalafix.internal.util.TypeSyntax.symbolToTree(TypeSyntax.scala:196)
	at scalafix.internal.util.TypeSyntax.toTypeRef(TypeSyntax.scala:287)
	at scalafix.internal.util.TypeSyntax.toType(TypeSyntax.scala:341)
	at scalafix.internal.util.TypeSyntax.$anonfun$toType$1(TypeSyntax.scala:297)
	at scala.collection.Iterator$$anon$10.next(Iterator.scala:448)
	at scala.collection.Iterator.foreach(Iterator.scala:929)
	at scala.collection.Iterator.foreach$(Iterator.scala:929)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
	at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:59)
	at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:50)
	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:186)
	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:44)
	at scala.collection.TraversableOnce.to(TraversableOnce.scala:310)
	at scala.collection.TraversableOnce.to$(TraversableOnce.scala:308)
	at scala.collection.AbstractIterator.to(Iterator.scala:1417)
	at scala.collection.TraversableOnce.toList(TraversableOnce.scala:294)
	at scala.collection.TraversableOnce.toList$(TraversableOnce.scala:294)
	at scala.collection.AbstractIterator.toList(Iterator.scala:1417)
	at scalafix.internal.util.TypeSyntax.targs$1(TypeSyntax.scala:297)
	at scalafix.internal.util.TypeSyntax.toType(TypeSyntax.scala:347)
	at scalafix.internal.util.TypeSyntax.prettify(TypeSyntax.scala:449)
	at scalafix.internal.util.TypeSyntax$.prettify(TypeSyntax.scala:28)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$3(ExplicitResultTypes.scala:82)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$2(ExplicitResultTypes.scala:81)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$1(ExplicitResultTypes.scala:80)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.defnType$1(ExplicitResultTypes.scala:79)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$9(ExplicitResultTypes.scala:100)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$7(ExplicitResultTypes.scala:98)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.$anonfun$fix$5(ExplicitResultTypes.scala:94)
	at scala.Option.flatMap(Option.scala:171)
	at scalafix.internal.rule.ExplicitResultTypes.scalafix$internal$rule$ExplicitResultTypes$$fix$1(ExplicitResultTypes.scala:93)
	at scalafix.internal.rule.ExplicitResultTypes$$anonfun$fix$15.applyOrElse(ExplicitResultTypes.scala:151)
	at scalafix.internal.rule.ExplicitResultTypes$$anonfun$fix$15.applyOrElse(ExplicitResultTypes.scala:148)
	at scala.PartialFunction$Lifted.apply(PartialFunction.scala:224)
	at scala.PartialFunction$Lifted.apply(PartialFunction.scala:220)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$4$.apply(Api.scala:32)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$4$.apply(Api.scala:33)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$4$.apply(Api.scala:33)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$4$.apply(Api.scala:33)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Traverser.apply(Traverser.scala:4)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$4$.apply(Api.scala:33)
	at scala.meta.transversers.Api$XtensionCollectionLikeUI.collect(Api.scala:36)
	at scalafix.internal.rule.ExplicitResultTypes.fix(ExplicitResultTypes.scala:148)
	at scalafix.rule.Rule.fixWithName(Rule.scala:104)
	at scalafix.rule.Rule$CompositeRule.$anonfun$fixWithName$2(Rule.scala:139)
	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:122)
	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:118)
	at scala.collection.immutable.List.foldLeft(List.scala:86)
	at scalafix.rule.Rule$CompositeRule.fixWithName(Rule.scala:139)
  implicit val map = new java.util.HashMap[Int, java.lang.String]().entrySet()
               ^
@olafurpg
Copy link
Contributor Author

Fixed in #675 with the introduction of PrettyType

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

No branches or pull requests

1 participant