Compiler crash when referencing 'Self' from a stored property initializer in an extension

Originator:ld
Number:rdar://FB7597747 Date Originated:24/02/2020
Status:Resolved Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
The swift compiler crashes (instead of giving a compile-time error) when referencing `Self` from a stored property initializer.

Example code:

import Foundation

class A {}

extension A {
  static let b = Self.c // this crashes the compiler
  static let c = 3
}

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!