# Computed Properties in functions

**URL:** https://talk.remobjects.com/t/computed-properties-in-functions/20928
**Category:** Elements Bugs
**Tags:** swift
**Created:** [December 12, 2019, 12:47am UTC](https://talk.remobjects.com/t/computed-properties-in-functions/20928 "2019-12-12T00:47:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dbroggi](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dbroggi](https://talk.remobjects.com/u/dbroggi)
#### Post date: [December 12, 2019, 12:47am UTC](https://talk.remobjects.com/t/computed-properties-in-functions/20928/1 "2019-12-12T00:47:28Z")

</div>

**IDE:** _Visual Studio X/Fire_  
**Version:** _10.0.0.2461 (develop)_  
**Target** (If relevant): _Island(OSX)_  
**Description** :  
Swift allows declaring computed “properties”, that is variables with a getter and setter, within a function.

**Expected Behavior** :  
Compiles  
**Actual Behavior** :  
See below.  
**Steps** :

```auto
  func local_properties<T>(_ t: inout T) {
	  var prop: T { // E504 Semicolon (;) required to separate two statements on the same line
					// E120 Statement expected
		  get {
			  return t
		  }
		  set {
			  t = newValue
		  }
	  }
	  
	  var foo: Int { 0 } // E504 Semicolon (;) required to separate two statements on the same line
						 // E120 Statement expected
  }

```

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [December 12, 2019, 3:02pm UTC](https://talk.remobjects.com/t/computed-properties-in-functions/20928/2 "2019-12-12T15:02:23Z")

</div>

Thanks, logged as [bugs://83648](https://www.remobjects.com/portal/bugs/?id=83648)

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [December 16, 2019, 2:07pm UTC](https://talk.remobjects.com/t/computed-properties-in-functions/20928/3 "2019-12-16T14:07:01Z")

</div>

[bugs://83648](https://www.remobjects.com/portal/bugs/?id=83648) got closed with status fixed.
