# Parser rejects some constructs involving \`Self\`

**URL:** https://talk.remobjects.com/t/parser-rejects-some-constructs-involving-self/19732
**Category:** Elements Bugs
**Tags:** silver
**Created:** [June 22, 2019, 12:53am UTC](https://talk.remobjects.com/t/parser-rejects-some-constructs-involving-self/19732 "2019-06-22T00:53:59Z")
**Posts on this page:** 2
**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: [June 22, 2019, 12:53am UTC](https://talk.remobjects.com/t/parser-rejects-some-constructs-involving-self/19732/1 "2019-06-22T00:53:59Z")

</div>

**IDE:** _Visual Studio X/Fire_  
**Version:** _10.0.0.2415 (develop)_  
**Target** (If relevant): _OSX_  
**Description** :  
The parser rejects some constructs involving `Self` (in a protocol extension).

**Expected Behavior** :  
Compiles?  
**Actual Behavior** :  
Parser Errors  
**Steps** :

```auto
protocol Foo {
	static func foo()
}

protocol RR {
  associatedtype RawValue: Foo
  init?(rawValue: RawValue)
}

extension RR {
  public static func foo() { // E1 closing bracket expected, got "Self"
	Self.RawValue.foo()
  }

  public static func bar() {
	var innerResult: Self.RawValue?
	innerResult.flatMap { Self(rawValue: $0) } // E1 closing bracket expected, got "Self"
											   // E484 Cannot access members on wrapped nullable type "RawValue?"
											   // E44 No member "flatMap " on type "RawValue"
  }
}

```

---

<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: [June 24, 2019, 4:51am UTC](https://talk.remobjects.com/t/parser-rejects-some-constructs-involving-self/19732/2 "2019-06-24T04:51:47Z")

</div>

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