mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
lang: allow "slice_var as ptr array[etc] etc"
This commit is contained in:
1 parent
6411561deb
commit
19f56ebfd2
7 files changed
+83
-5
No files matched your search
@@ -941,6 +941,16 @@ func (n *TypeExpr) IsReadOnly() bool {
|
||||
return (n.id0 == t.IDRoarray) || (n.id0 == t.IDRoslice) || (n.id0 == t.IDRotable)
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsRecursivelyReadOnly() bool {
|
||||
for ; n != nil; n = n.Inner() {
|
||||
switch n.id0 {
|
||||
case t.IDRoarray, t.IDRoslice, t.IDRotable:
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsContainerOfSpecificNumType(container t.ID, numType t.ID) bool {
|
||||
return (n.id0 == container) && n.Inner().IsNumType() && (n.Inner().id2 == numType)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user