checkedc icon indicating copy to clipboard operation
checkedc copied to clipboard

bounds declarations defined/used in different checked contexts

Open dtarditi opened this issue 7 years ago • 0 comments

We can define a variable with a bounds declaration in an unchecked scope and use it in a checked scopes. This raises several questions because of the "by reference" use of the bounds declaration at the point of use of the variable.

  1. If the variable has a bounds declaration that uses unchecked pointer types, is it OK to use that variable in a checked scope where bounds checking is required? My first thought is "no, that should not be allowed."
  2. If the variable has a bounds declaration that uses variables with unchecked pointer types that have bounds-safe interfaces is that OK? My first thought is "yes, that should be allowed".

A related question: if a variable declared in an unchecked scope has a bounds declaration that uses variables with bounds-safe interfaces, what should the types of those variables be within the bounds declaration? Checked or unchecked pointers? It seems reasonable we should have them use the bounds-safe interface type within the bounds declaration.

dtarditi avatar Feb 12 '18 01:02 dtarditi