Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
qir
Commits
e02f6a57
Commit
e02f6a57
authored
6 years ago
by
Julien Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Fix in subtype for QIRSomeType
parent
be463ac1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#710
failed
6 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/qir/types/QIRRecordType.java
+2
-2
2 additions, 2 deletions
src/qir/types/QIRRecordType.java
src/qir/types/QIRSomeType.java
+3
-8
3 additions, 8 deletions
src/qir/types/QIRSomeType.java
with
5 additions
and
10 deletions
src/qir/types/QIRRecordType.java
+
2
−
2
View file @
e02f6a57
...
...
@@ -41,7 +41,7 @@ public class QIRRecordType extends QIRType {
return
fieldTypes
.
get
(
id
);
}
public
final
boolean
union
With
(
final
QIRRecordType
other
)
{
public
final
boolean
union
(
final
QIRRecordType
other
)
{
for
(
Entry
<
String
,
QIRType
>
otherEntry
:
other
.
fieldTypes
.
entrySet
())
{
final
String
otherKey
=
otherEntry
.
getKey
();
final
QIRType
otherValue
=
otherEntry
.
getValue
();
...
...
@@ -61,7 +61,7 @@ public class QIRRecordType extends QIRType {
final
QIRRecordType
res
=
new
QIRRecordType
(
new
HashMap
<>());
for
(
int
i
=
0
;
i
<
records
.
length
;
i
++)
res
.
union
With
(
records
[
i
]);
res
.
union
(
records
[
i
]);
return
res
;
}
...
...
This diff is collapsed.
Click to expand it.
src/qir/types/QIRSomeType.java
+
3
−
8
View file @
e02f6a57
...
...
@@ -24,20 +24,15 @@ public class QIRSomeType extends QIRType {
@Override
protected
boolean
isSubtypeOfSpecific
(
final
QIRType
other
)
{
if
(
other
instanceof
QIRRecordType
)
{
if
(
infered
.
isPresent
())
{
if
(
infered
.
get
()
instanceof
QIRRecordType
)
{
((
QIRRecordType
)
infered
.
get
()).
unionWith
((
QIRRecordType
)
other
);
return
true
;
}
else
return
false
;
}
if
(
infered
.
isPresent
())
return
infered
.
get
()
instanceof
QIRRecordType
&&
((
QIRRecordType
)
infered
.
get
()).
union
((
QIRRecordType
)
other
);
infered
=
Optional
.
of
(
other
);
return
true
;
}
if
(!
infered
.
isPresent
()
||
other
.
isSubtypeOf
(
infered
.
get
()))
{
if
(
other
instanceof
QIRSomeType
)
{
if
(((
QIRSomeType
)
other
).
infered
.
isPresent
())
infered
=
Optional
.
of
(
((
QIRSomeType
)
other
).
infered
.
get
())
;
infered
=
((
QIRSomeType
)
other
).
infered
;
}
else
infered
=
Optional
.
of
(
other
);
return
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment