implemented dataflow analysis; activate via --warning[Uninit]:on
This commit is contained in:
parent
f7c0cc976d
commit
2aaa8f7909
6 changed files with 185 additions and 26 deletions
|
|
@ -9,6 +9,8 @@ proc parseInt(x: int8): int {.noSideEffect.} = nil
|
|||
proc parseInt(x: TFile): int {.noSideEffect.} = nil
|
||||
proc parseInt(x: char): int {.noSideEffect.} = nil
|
||||
proc parseInt(x: int16): int {.noSideEffect.} = nil
|
||||
|
||||
proc parseInt[T](x: T): int = echo x; 34
|
||||
|
||||
type
|
||||
TParseInt = proc (x: string): int {.noSideEffect.}
|
||||
|
|
@ -33,3 +35,5 @@ type
|
|||
|
||||
proc bar[a,b](f: TFoo[a,b], x: a) = echo(x, " ", f.lorem, f.ipsum)
|
||||
proc bar[a,b](f: TFoo[a,b], x: b) = echo(x, " ", f.lorem, f.ipsum)
|
||||
|
||||
discard parseInt[string]("yay")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue