Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
vala
vala
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 702
    • Issues 702
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 38
    • Merge Requests 38
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • GNOME
  • valavala
  • Issues
  • #302

Closed
Open
Opened May 27, 2012 by bugzilla-migration@bugzilla-migrationReporter

Modifying public struct property using foreach statement

Submitted by sta..@..il.com

Link to original bug (#676933)

Description

public struct Test { public int x;

public Test(int x)
{
	this.x = x;
}

}

Test[] test;

void main (string[] args) { test += Test(1); test += Test(2); test += Test(3);

foreach(unowned Test t in test)
	t.x++;

test[2].x++;

foreach(unowned Test t in test)
	stdout.printf("x=%d\n", t.x);

}

/* OUTPUT: x=1 x=2 x=4 */

Version: 0.16.x

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/vala#302