A ProducingAnnotationTrigger is a possible reason that a nil value might be produced All ProducingAnnotationTriggers must embed one of the following 4 structs: -TriggerIfNilable -TriggerIfDeepNilable -ProduceTriggerTautology -ProduceTriggerNever This is because there are interfaces, such as Admits
| 35 | // This is because there are interfaces, such as AdmitsPrimitive, that are implemented only for those |
| 36 | // structs, and to which a ProducingAnnotationTrigger must be able to be case |
| 37 | type ProducingAnnotationTrigger interface { |
| 38 | // CheckProduce can be called to determined whether this trigger should be triggered |
| 39 | // given a particular Annotation map |
| 40 | // for example - a `FuncReturn` trigger triggers iff the corresponding function has |
| 41 | // nilable return type |
| 42 | CheckProduce(Map) bool |
| 43 | |
| 44 | // NeedsGuardMatch returns whether this production is contingent on being |
| 45 | // paired with a guarded consumer. |
| 46 | // In other words, this production is only given the freedom to produce |
| 47 | // a non-nil value in the case that it is matched with a guarded consumer. |
| 48 | // otherwise, it is replaced with annotation.GuardMissing |
| 49 | NeedsGuardMatch() bool |
| 50 | |
| 51 | // SetNeedsGuard sets the underlying Guard-Neediness of this ProduceTrigger, if present |
| 52 | // This should be very sparingly used, and only with utter conviction of correctness. |
| 53 | // Default setting for ProduceTriggers is to not need a guard. |
| 54 | SetNeedsGuard(bool) |
| 55 | |
| 56 | Prestring() Prestring |
| 57 | |
| 58 | // Kind returns the kind of the trigger. |
| 59 | Kind() TriggerKind |
| 60 | |
| 61 | // UnderlyingSite returns the underlying site this trigger's nilability depends on. If the |
| 62 | // trigger always or never fires, the site is nil. |
| 63 | UnderlyingSite() Key |
| 64 | |
| 65 | // equals returns true if the passed ProducingAnnotationTrigger is equal to this one |
| 66 | equals(ProducingAnnotationTrigger) bool |
| 67 | } |
| 68 | |
| 69 | // TriggerIfNilable is a general trigger indicating that the bad case occurs when a certain Annotation |
| 70 | // key is nilable |
no outgoing calls
no test coverage detected