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

NullPointerException while compile Flat.scala in example project #21

Open
jilen opened this issue Apr 18, 2016 · 5 comments
Open

NullPointerException while compile Flat.scala in example project #21

jilen opened this issue Apr 18, 2016 · 5 comments

Comments

@jilen
Copy link

jilen commented Apr 18, 2016

[info] Compiling 5 Scala sources to /home/jilen/workspace/flow-comprehensions-example/target/scala-2.11/classes...
[error] /home/jilen/workspace/flow-comprehensions-example/Flat.scala:18: exception during macro expansion: 
[error] java.lang.NullPointerException
[error]     at scala.reflect.internal.Types$$anonfun$47.apply(Types.scala:4576)
[error]     at scala.reflect.internal.Types$$anonfun$47.apply(Types.scala:4576)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isSubType1(TypeComparers.scala:319)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isSubType(TypeComparers.scala:278)
[error]     at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16)
[error]     at scala.reflect.internal.Types$class.isSubArg$1(Types.scala:4117)
[error]     at scala.reflect.internal.Types$$anonfun$isSubArgs$2.apply(Types.scala:4120)
[error]     at scala.reflect.internal.Types$$anonfun$isSubArgs$2.apply(Types.scala:4120)
[error]     at scala.reflect.internal.util.Collections$class.corresponds3(Collections.scala:24)
[error]     at scala.reflect.internal.SymbolTable.corresponds3(SymbolTable.scala:16)
[error]     at scala.reflect.internal.Types$class.isSubArgs(Types.scala:4120)
[error]     at scala.reflect.internal.SymbolTable.isSubArgs(SymbolTable.scala:16)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.firstTry$1(TypeComparers.scala:402)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isSubType2(TypeComparers.scala:552)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isSubType1(TypeComparers.scala:320)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isSubType(TypeComparers.scala:278)
[error]     at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16)
[error]     at scala.reflect.internal.tpe.TypeComparers$class.isWeakSubType(TypeComparers.scala:575)
[error]     at scala.reflect.internal.SymbolTable.isWeakSubType(SymbolTable.scala:16)
[error]     at scala.reflect.internal.Types$Type.weak_$less$colon$less(Types.scala:825)
[error]     at scala.tools.nsc.typechecker.Infer$Inferencer.scala$tools$nsc$typechecker$Infer$Inferencer$$isCompatible(Infer.scala:305)
[error]     at scala.tools.nsc.typechecker.Infer$Inferencer.isWeaklyCompatible(Infer.scala:319)
[error]     at scala.tools.nsc.typechecker.Infer$Inferencer.isConservativelyCompatible(Infer.scala:328)
[error]     at scala.tools.nsc.typechecker.Infer$Inferencer.protoTypeArgs(Infer.scala:417)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.handlePolymorphicCall$1(Typers.scala:3505)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3534)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4545)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4579)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5342)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheckInternal$1$1.apply(Typers.scala:27)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheckInternal$1$1.apply(Typers.scala:27)
[error]     at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
[error]     at scala.reflect.macros.contexts.Typers$class.typecheckInternal$1(Typers.scala:27)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2$$anonfun$apply$1.apply(Typers.scala:28)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2$$anonfun$apply$1.apply(Typers.scala:28)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$3.apply(Typers.scala:24)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$3.apply(Typers.scala:24)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$withContext$1$1.apply(Typers.scala:25)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$withContext$1$1.apply(Typers.scala:25)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$1.apply(Typers.scala:23)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$1.apply(Typers.scala:23)
[error]     at scala.reflect.macros.contexts.Typers$class.withContext$1(Typers.scala:25)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2.apply(Typers.scala:28)
[error]     at scala.reflect.macros.contexts.Typers$$anonfun$typecheck$2.apply(Typers.scala:28)
[error]     at scala.reflect.internal.Trees$class.wrappingIntoTerm(Trees.scala:1716)
[error]     at scala.reflect.internal.SymbolTable.wrappingIntoTerm(SymbolTable.scala:16)
[error]     at scala.reflect.macros.contexts.Typers$class.withWrapping$1(Typers.scala:26)
[error]     at scala.reflect.macros.contexts.Typers$class.typecheck(Typers.scala:28)
[error]     at scala.reflect.macros.contexts.Context.typecheck(Context.scala:6)
[error]     at scala.reflect.macros.contexts.Context.typecheck(Context.scala:6)
[error]     at org.cvogt.flow.transforms.Normalize$$anonfun$rules$13.applyOrElse(Normalize.scala:123)
[error]     at org.cvogt.flow.transforms.Normalize$$anonfun$rules$13.applyOrElse(Normalize.scala:120)
[error]     at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
[error]     at org.cvogt.flow.FlowMacros.org$cvogt$flow$FlowMacros$$traverse$1(flow.scala:223)
[error]     at org.cvogt.flow.FlowMacros.transform(flow.scala:276)
[error]   def showPerson(id: Int): Task[String] = Task.flat{
[error]                                                    ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 1 s, completed 2016-4-18 13:24:10
@cvogt
Copy link
Owner

cvogt commented Apr 18, 2016

@jilen did you change the source code of the examples?

@jilen
Copy link
Author

jilen commented Apr 18, 2016

@cvogt No. By the way do you still working on this project ?

@cvogt
Copy link
Owner

cvogt commented Apr 18, 2016

We are planning on yes. Personally I am spending my free time on https://github.com/cvogt/cbt/ at the moment.

@jilen
Copy link
Author

jilen commented Apr 18, 2016

@cvogt Thoughtworks each has a serious issue with call-by-name parameter, and seems not able to fix it. Do you think this project would overcome this issue? That is the main reason I give up each

@cvogt
Copy link
Owner

cvogt commented Apr 18, 2016

There are limits to what the desugaring can do. Higher order-functions and call-by-name parameters can't be solved in a general way, only specific to known ones.

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

No branches or pull requests

2 participants