dart-lang / dart-lang/language

add a cheaper way to get the current source location

Open
#2,850 15 comments 15 reactions 0 assignees View on GitHub
customer-google3 feature
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

According to https://github.com/dart-lang/core/issues/432, we can get those info by inspecting a StackTrace(so javascript/go).

But that is a little expensive if you just want to log something.

Instead, a compile/transpile time constant would be a lot more cheaper, like the \__file__ & \__line__ macro in C++ or the std::source_location in C++ 20

Contributor guide

Open the contributing guide

Research direction

Start by reading the proposal and the linked dart-lang/core issue 432, focusing on the current StackTrace-based approach and the requested compile/transpile-time source information. Compare the Dart language and implementation implications with the cited C++ examples; done would require an agreed design for the feature, since no target files or tests are identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.