# SE-0359: Build-Time Constant Values

**URL:** <https://forums.swift.org/t/se-0359-build-time-constant-values/57562>\
**Category:** Proposal Reviews\
**Created:** [May 25, 2022, 4:28am UTC](https://forums.swift.org/t/se-0359-build-time-constant-values/57562 "2022-05-25T04:28:30Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![stevapple](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stevapple/32/31979_2.png) [@stevapple](https://forums.swift.org/u/stevapple)\
**Post date:** [May 25, 2022, 7:24am UTC](https://forums.swift.org/t/se-0359-build-time-constant-values/57562/9 "2022-05-25T07:24:53Z")

</div>

I would expect this to come with build-time evaluation so life will be easier and we can quickly expand the usage. As for now the feature is still too "weak" to be utilized.

I still don’t quite like the idea of an attribute. Is there any reason that we cannot make it a part of the type system? That is, we can have a series of new types called `const P` (combined using existing `any P` rules), and, like how we’re using non-`async` functions as `async`, allow implicit transformation from `const P` to `P`?

Consider the following example:

```swift
@propertyWrapper
struct SpecialSerializationSauce {
  init(key: const String) {...}
}

// compiles because string literal is inferred as `const String`
struct Foo {
  @SpecialSerializationSauce(key: "title") 
  var someSpecialTitleProperty: String
}

```

P.S. If there’re any source-breaking issues, we can delay the `const`-prioritized inference to Swift 6.

---

_[View the full topic](https://forums.swift.org/t/se-0359-build-time-constant-values/57562)._
