Closed momohatt closed 4 years ago
Currently, a type of a list changes in a program when updated.
x = [1, 2, 3] # x : [int, int, int] x.append(4) # x : int list
(cf. https://github.com/pfnet-research/chainer-compiler/compare/master...momohatt:list-invariant?expand=1#diff-5c356c79d973908cc78cef75c3d6ed41L526-L527 ) However, because Python lists are mutable, such changes to types can ruin the soundness when alias analysis is not present. This PR fixes this problem by fixating the type of lists in a program as follows.
x = [1, 2, 3] # x : int list <- not '[int, int, int]' x.append(4) # x : int list y = [1,2] # y : optional(int) list y.append(None) # y : optional(int) list
/test
Successfully created a job for commit 066a9c8:
Currently, a type of a list changes in a program when updated.
(cf. https://github.com/pfnet-research/chainer-compiler/compare/master...momohatt:list-invariant?expand=1#diff-5c356c79d973908cc78cef75c3d6ed41L526-L527 ) However, because Python lists are mutable, such changes to types can ruin the soundness when alias analysis is not present. This PR fixes this problem by fixating the type of lists in a program as follows.