Files
swift-mirror/test/SIL/Parser/final.swift
Slava Pestov 2e635e9603 Sema: Add @_hasInitialValue and @_hasStorage in typeCheckDecl() not validateDecl()
We only ever use this in TBDGen and interface printing, and we only ever
generate TBD files or print interfaces for declarations in primary files,
so let's avoid unnecessary work in validateDecl().

Eventually we want validateDecl() to be replaced with a getInterfaceType()
request, so adding new attributes in this path (or other side effects in
general) is a big no-no.
2019-01-02 15:12:02 -05:00

15 lines
334 B
Swift

// RUN: %target-swift-frontend %s -emit-silgen | %FileCheck %s
// CHECK: final class Rect
// CHECK: @_hasStorage @_hasInitialValue final var orgx: Double
final class Rect {
var orgx = 0.0
}
protocol P { }
// CHECK: struct Rect2 : P {
// CHECK: @_hasStorage @_hasInitialValue var orgx: Double
struct Rect2 : P {
var orgx = 0.0
}