setUnsafePreview

Like setUnsafe, but for safety errors still behind preview switches

Given a FeatureState fs, for example dip1000 / dip25 / systemVariables, the behavior changes based on the setting:

- In case of -revert=fs, it does nothing. - In case of -preview=fs, it's the same as setUnsafe - By default, print a deprecation in @safe functions, or store an attribute violation in inferred functions.

bool
setUnsafePreview
(,,
bool gag
,,
const(char)* msg
,
RootObject arg0 = null
,
RootObject arg1 = null
,
RootObject arg2 = null
)

Parameters

sc Scope*

used to find affected function/variable, and for checking whether we are in a deprecated / speculative scope

fs FeatureState

feature state from the preview flag

gag bool

surpress error message

loc Loc

location of error

msg const(char)*

printf-style format string

arg0 RootObject

(optional) argument for first %s format specifier

arg1 RootObject

(optional) argument for second %s format specifier

arg2 RootObject

(optional) argument for third %s format specifier

Return Value

Type: bool

whether an actual safe error (not deprecation) occured

Meta