Skip to content

feat: enable explicit backing fields#20500

Merged
criticalAY merged 1 commit intoankidroid:mainfrom
criticalAY:feat/exp-backing-field
Mar 22, 2026
Merged

feat: enable explicit backing fields#20500
criticalAY merged 1 commit intoankidroid:mainfrom
criticalAY:feat/exp-backing-field

Conversation

@criticalAY
Copy link
Copy Markdown
Contributor

Purpose / Description

I want to Enable field backing for Kotlin (Kotlin automatically generates a backing field for properties that reference the field keyword in their custom accessors, though in experimental phase)

Here is what it will look like for VMs since most of the time we use this pattern in VMs

Before

private val _something = MutableStateFlow("")
val something: StateFlow<String> = _something

After

val something: StateFlow<String>
    field = MutableStateFlow("")

Fixes

NA

Approach

I simply added "-Xexplicit-backing-fields" but there was warning in code for which I did a workaround to fix it, I have commented on the val to better explanation

How Has This Been Tested?

Compiled the code and tried adding field property to a class

Learning (optional, can help others)

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swear this was a draft, sorry it got missed!

Please add some documentation links to the commit message

  • title:
- feat: enable explicit backing field
+ feat: enable explicit backing fields

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Mar 20, 2026
@criticalAY criticalAY changed the title feat: enable explicit backing field feat: enable explicit backing fields Mar 21, 2026
@criticalAY criticalAY force-pushed the feat/exp-backing-field branch from 30fe025 to 5199797 Compare March 21, 2026 17:49
@david-allison
Copy link
Copy Markdown
Member

david-allison commented Mar 22, 2026

Can't force push myself right now, but make the change to the commit title of: feat: enable explicit backing fields and feel free to merge

Low risk, and it's blocking you from doing something awesome

@criticalAY criticalAY force-pushed the feat/exp-backing-field branch from 5199797 to 9d68bd4 Compare March 22, 2026 13:43
@criticalAY criticalAY added this pull request to the merge queue Mar 22, 2026
Merged via the queue into ankidroid:main with commit aad363f Mar 22, 2026
13 checks passed
@github-actions github-actions Bot removed the Needs Second Approval Has one approval, one more approval to merge label Mar 22, 2026
@github-actions github-actions Bot added this to the 2.24 release milestone Mar 22, 2026
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

Successfully merging this pull request may close these issues.

2 participants