Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Strange compilation error detection #116

Open
MaxGraey opened this issue Jun 15, 2017 · 1 comment
Open

Strange compilation error detection #116

MaxGraey opened this issue Jun 15, 2017 · 1 comment
Labels

Comments

@MaxGraey
Copy link
Contributor

MaxGraey commented Jun 15, 2017

Code:

export function grayscaleImage(data: Array<int8>, width: int32, height: int32): void {
  let len: int32 = width * height;
  let i:   int32 = 0;
  
  while (i < len)
    let r: float32 = data[i * 4 + 0] as float32;
    let g: float32 = data[i * 4 + 1] as float32;
    let b: float32 = data[i * 4 + 2] as float32;

    let result: int8 = (0.2126 * r + 0.7152 * g + 0.0722 * b) as int8;
    
    data[i * 4 + 0] = result;
    data[i * 4 + 1] = result;
    data[i * 4 + 2] = result;

    i++;
  }
}

Error:

(10:34)
ERROR: 
terminal.ts:24 No symbol named 'r' here
terminal.ts:24     let result: int8 = (0.2126 * r + 0.7152 * g + 0.0722 * b) as int8;

But problem with skipped open brace '{' after while

@MaxGraey MaxGraey changed the title Stange compilation error Stange compilation error detection Jun 15, 2017
@nidin
Copy link
Contributor

nidin commented Jun 16, 2017

Nice catch. I will investigate it.

@nidin nidin changed the title Stange compilation error detection Strange compilation error detection Jun 16, 2017
@nidin nidin added the bug label Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants