Skip to content

Is PositionMethods startLine 0-based intentionally? #12728

Discussion options

You must be logged in to vote

I wasn't sure if this was intentional - should I just resort to adding a +1 to my macro in Scala 3, or should I make a bug report?

This was intentional. The line/column indexing is 0-based. The documentation should be clearer about this.

This is the position in the file which annoyingly is not the same as in editors. We chose this variant to avoid overhead in the reflection API implementation.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@som-snytt
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by dylemma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants