Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
f0c38fa1
Commit
f0c38fa1
authored
Nov 12, 2018
by
johnvg@science.ru.nl
Browse files
fix using specials in fusion of lazy or boxed arrays or lazy or boxed lists
parent
0c647aba
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/trans.icl
View file @
f0c38fa1
...
...
@@ -5095,7 +5095,7 @@ minimiseContext {tc_class = TCClass gds} (TA ti ts)
=
[]
minimiseContext
_
_
=
[]
findInstInSpecials
::
![[
.
Type
]]
![
.
Special
]
->
.
(!
Int
,!
(
Global
Int
)
)
findInstInSpecials
::
![[
Type
]]
![
Special
]
->
(!
Int
,!
Global
Int
)
findInstInSpecials
insts
[]
=
(
0
,{
glob_object
=
-1
,
glob_module
=
-1
})
findInstInSpecials
insts
[{
spec_types
,
spec_index
}:
specials
]
...
...
@@ -5103,9 +5103,13 @@ findInstInSpecials insts [{spec_types,spec_index}:specials]
=
(
length
spec_types
,
spec_index
)
=
findInstInSpecials
insts
specials
matchTypes
::
![[
Type
]]
![[
Type
]]
->
Bool
matchTypes
[]
[]
=
True
matchTypes
[[
TA
ltsi
[],_]:
ls
]
[[
TA
rtsi
[],
TV
_]:
rs
]
// second arg is contexts of special, a TV can only occur as lazy or boxed element of an array or list
=
rtsi
==
ltsi
&&
matchTypes
ls
rs
matchTypes
[
l
:
ls
]
[
r
:
rs
]
=
l
==
r
&&
matchTypes
ls
rs
=
l
==
r
&&
matchTypes
ls
rs
matchTypes
_
_
=
False
foundSpecial
{
glob_object
=
-1
,
glob_module
=
-1
}
=
False
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment