JakeWharton / JakeWharton/cite

Support getting call site position of a function

Open
#20 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
371
Forks
10
Avg merge
18h 7m
Merged PRs (30d)
13

Description

Consider this example:
```
fun test(lineNumber: Int = __LINE__) {
println("$lineNumber")
}

test()
test()
```
It prints the same value twice. This means that it's impossible to get a call site position of a function using Cite. It's supported in Swift.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the issue's Kotlin example and inspect the Cite compiler plugin's handling of __LINE__. Compare the requested call-site behavior with the existing function-default behavior and determine what compiler information must be preserved; done means repeated test() calls report their distinct call-site positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.