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

java.lang.NullPointerException on const type + infix resolving #277

Open
tribbloid opened this issue Apr 18, 2024 · 0 comments
Open

java.lang.NullPointerException on const type + infix resolving #277

tribbloid opened this issue Apr 18, 2024 · 0 comments

Comments

@tribbloid
Copy link

(moving from scala/bug#12986)

Reproduction steps

Scala version: 2.13.13

    trait +[A, B]
    trait *[A, B]

    implicitly[(1 + 3 * 4) =:= (1 + (3 * 4))]

Problem

the compiler gave the following error:

java.lang.NullPointerException: Cannot invoke "scala.reflect.internal.Trees$Tree.canHaveAttrs()" because "t" is null
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:377)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:374)
	at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2509)
	at scala.reflect.api.Trees$Traverser.traverseParams(Trees.scala:2517)
	at scala.reflect.internal.Trees$TypeDef.$anonfun$traverse$5(Trees.scala:485)
	at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2532)
	at scala.reflect.internal.Trees$TypeDef.traverse(Trees.scala:482)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:380)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:374)
	at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2509)
	at scala.reflect.api.Trees$Traverser.traverseParams(Trees.scala:2517)
	at scala.reflect.internal.Trees$TypeDef.$anonfun$traverse$5(Trees.scala:485)
	at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2532)
	at scala.reflect.internal.Trees$TypeDef.traverse(Trees.scala:482)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:380)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:374)
	at scala.reflect.api.Trees$Traverser.$anonfun$traverseStats$2(Trees.scala:2523)
	at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2532)
	at scala.reflect.api.Trees$Traverser.$anonfun$traverseStats$1(Trees.scala:2523)
	at scala.reflect.api.Trees$Traverser.traverseStats(Trees.scala:2522)
	at scala.reflect.internal.Trees$Template.traverse(Trees.scala:550)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:380)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:374)
	at scala.reflect.internal.Trees$CompoundTypeTree.traverse(Trees.scala:940)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:380)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:374)
	at scala.reflect.internal.Trees$SelectFromTypeTree.traverse(Trees.scala:929)
	at scala.reflect.internal.Positions$DefaultPosAssigner.traverse(Positions.scala:380)
	at scala.reflect.internal.Positions.atPos(Positions.scala:402)
	at scala.reflect.internal.Positions.atPos$(Positions.scala:399)
	at scala.reflect.internal.SymbolTable.atPos(SymbolTable.scala:28)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:388)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:56)
	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2594)
	at scala.reflect.internal.Trees$AppliedTypeTree.transform(Trees.scala:953)
	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:57)
	at d_m.KindRewriter$MyTransformer.makeTypeProjection$1(KindProjector.scala:237)
	at d_m.KindRewriter$MyTransformer.handlePlaceholders$1(KindProjector.scala:309)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:387)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:56)
	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2594)
	at scala.reflect.internal.Trees$TypeApply.transform(Trees.scala:775)
	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:57)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:394)
	at d_m.KindRewriter$MyTransformer.transform(KindProjector.scala:56)
	at scala.reflect.internal.Trees$ValDef.$anonfun$transform$4(Trees.scala:435)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2636)
	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:43)
	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:32)
	at scala.reflect.internal.Trees$ValDef.transform(Trees.scala:434)
...

(see https://scastie.scala-lang.org/tribbloid/VyyLFjLwQDiwB8Gs6mYbkA/25 for a reproduction)

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

1 participant