PolymerLabs / arcs

Arcs
BSD 3-Clause "New" or "Revised" License
56 stars 35 forks source link

Confusing error message: Type validations failed for handle ...: could not guarantee viariable ~ meets read requirements... #7121

Open shans opened 3 years ago

shans commented 3 years ago

(from b/170756456)

The following error is difficult to understand as a manifest author. What am I supposed to look for to resolve the error? Some kind of hint as to what to do would be helpful.

Type validations failed for handle 'create 'permissions'': could not guarantee 
variable ~ meets read requirements PermissionStates {recordAudio: Boolean} with 
write guarantees PermissionState {recordAudio: Boolean}

Amalgamated manifest:

schema AudioBuffer
  timestamp: Instant
  length: Int
  base64Data: Text

schema PermissionState
  recordAudio: Boolean

@ingress
particle AudioSensor in '.AudioSensor'
  permissions: reads PermissionStates{recordAudio: Boolean}
  audio: writes AudioBuffer

@ingress
particle PermissionSensor in '.PermissionSensor'
  permissions: writes PermissionState

@arcId('sensing')
recipe Sensing
  permissions: create 'permissions'
  audio: create 'audio-signals'

  AudioSensor
    permissions: permissions
    audio: audio

  PermissionSensor
    permissions: permissions