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

rangepos error on type-parameterized infix method call #10240

Closed
scabug opened this issue Mar 19, 2017 · 2 comments
Closed

rangepos error on type-parameterized infix method call #10240

scabug opened this issue Mar 19, 2017 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 19, 2017

Reproduce code:

object Test1 { 1 -> 2 }       // ok
object Test2 { 1.->(2) }      // ok
object Test3 { 1.->[Int](2) } // ok
object Test4 { 1 ->[Int] 2 }  // fails

object Test5 { List(1,2).foreach(println) }       // ok
object Test6 { List(1,2) foreach println }        // ok
object Test7 { List(1,2).foreach[Unit](println) } // ok
object Test8 { List(1,2) foreach[Unit] println }  // fails

Reproduce steps:

scala -Yrangepos -e "1 ->[Int] 2"

Expected result:
compiles

Actual result:

======= Position error
Enclosing tree [28] does not include tree [27]
== Enclosing tree [28] of type TypeApply at [0:1]scalacmd6534136997205619280.scala

[L   1        ] #28     [0:1]           TypeApply  // 1 

== Enclosed tree [27] of type Select at [0:4]scalacmd6534136997205619280.scala

[L   1        ] #27     [0:4]           Select     // ->[In


While validating #67
[L   1        ] #67     [0:11]          PackageDef // 1 ->[Int] 2

Children:
  [L   1 P#   67] #66     [0:0]           Ident      // 1
  [L   1 P#   67] #65     [0:11]          ModuleDef  // 1 ->[Int] 2
=======
error: Compile server encountered fatal condition: Enclosing tree [28] does not include tree [27]

Note: This example produces a syntax error in 2.10.x but is ok in 2.11+ without -Yrangepos.

@scabug
Copy link
Author

scabug commented Mar 19, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10240?orig=1
Reporter: @refried
Affected Versions: 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.11.4, 2.11.5, 2.11.6, 2.11.7, 2.11.8, 2.12.0, 2.12.1

@scabug
Copy link
Author

scabug commented Mar 20, 2017

@som-snytt said:
scala/scala#5787

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

3 participants