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

Crash in TypeDiagnostics.record #5833

Closed
scabug opened this issue May 24, 2012 · 3 comments
Closed

Crash in TypeDiagnostics.record #5833

scabug opened this issue May 24, 2012 · 3 comments

Comments

@scabug
Copy link

@scabug scabug commented May 24, 2012

I see this quite often while typing in the IDE. probably the code has errors, but sometimes even when it doesn't. At any rate, it's probably better to catch exceptions thrown during recording type diagnostics logging, since often you may have malformed types.

I don't have a reproducible case, unfortunately.

java.lang.UnsupportedOperationException: tail of empty list
	at scala.collection.immutable.Nil$.tail(List.scala:320)
	at scala.collection.immutable.Nil$.tail(List.scala:315)
	at scala.reflect.internal.Types$RefinedType.normalizeImpl(Types.scala:1625)
	at scala.reflect.internal.Types$RefinedType.normalize(Types.scala:1616)
	at scala.reflect.internal.Definitions$DefinitionsClass.isFunctionType(Definitions.scala:681)
	at scala.reflect.internal.Types$TypeRef.customToString(Types.scala:2319)
	at scala.reflect.internal.Types$TypeRef.safeToString(Types.scala:2333)
	at scala.reflect.internal.Types$class.typeToString(Types.scala:6785)
	at scala.reflect.internal.SymbolTable.typeToString(SymbolTable.scala:13)
	at scala.reflect.internal.Types$Type.toString(Types.scala:945)
	at java.lang.String.valueOf(String.java:2826)
	at scala.tools.nsc.typechecker.TypeDiagnostics$class.record$1(TypeDiagnostics.scala:332)
	at scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$typeDiags$1$$anonfun$apply$2.apply(TypeDiagnostics.scala:338)
	at scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$typeDiags$1$$anonfun$apply$2.apply(TypeDiagnostics.scala:335)
	at scala.Function1$class.apply$mcVL$sp(Function1.scala:39)
	at scala.runtime.AbstractFunction1.apply$mcVL$sp(AbstractFunction1.scala:12)
	at scala.reflect.internal.Types$ForEachTypeTraverser.traverse(Types.scala:4726)
	at scala.reflect.internal.Types$Type.foreach(Types.scala:774)
	at scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$typeDiags$1.apply(TypeDiagnostics.scala:335)
	at scala.tools.nsc.typechecker.TypeDiagnostics$$anonfun$typeDiags$1.apply(TypeDiagnostics.scala:335)
	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
	at scala.collection.immutable.List.foreach(List.scala:77)
	at scala.tools.nsc.typechecker.TypeDiagnostics$class.typeDiags(TypeDiagnostics.scala:335)
	at scala.tools.nsc.typechecker.TypeDiagnostics$class.withDisambiguation(TypeDiagnostics.scala:358)
	at scala.tools.nsc.Global$$anon$1.withDisambiguation(Global.scala:460)
	at scala.tools.nsc.typechecker.TypeDiagnostics$class.foundReqMsg(TypeDiagnostics.scala:264)
	at scala.tools.nsc.Global$$anon$1.foundReqMsg(Global.scala:460)
	at scala.tools.nsc.typechecker.ContextErrors$ErrorUtils$.typeErrorMsg(ContextErrors.scala:81)
	at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:146)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1200)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5026)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:2677)
	at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:2677)
	at scala.tools.nsc.typechecker.Typers$Typer.loop$1(Typers.scala:2696)
	at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:2702)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:2943)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3016)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4133)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4843)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5017)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2567)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.collection.immutable.List.loop$1(List.scala:163)
	at scala.collection.immutable.List.mapConserve(List.scala:179)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2662)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2154)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$3.apply(Typers.scala:4699)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4698)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5017)
	at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5222)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:1986)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4667)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5017)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2567)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.collection.immutable.List.loop$1(List.scala:163)
	at scala.collection.immutable.List.mapConserve(List.scala:179)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2662)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1730)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$39.apply(Typers.scala:1593)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1592)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4654)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5017)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2567)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2663)
	at scala.collection.immutable.List.loop$1(List.scala:163)
	at scala.collection.immutable.List.mapConserve(List.scala:179)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2663)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2662)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4650)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5017)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5075)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:97)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:431)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1066)
	at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1066)
	at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1059)
	at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:562)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$4$$anonfun$apply$5.apply(Global.scala:478)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$4.apply(Global.scala:474)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$4.apply(Global.scala:474)
	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:759)
	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
	at scala.collection.immutable.List.foreach(List.scala:77)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:758)
	at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:474)
	at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)
@scabug
Copy link
Author

@scabug scabug commented May 24, 2012

@scabug
Copy link
Author

@scabug scabug commented Jan 23, 2013

@adriaanm said:
upping priority to help improve IDE experience

@scabug
Copy link
Author

@scabug scabug commented Feb 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant