Skip to content

Commit 07b15e8

Browse files
Fix subtyping
Ideally, we should have `diff::Union{Differential,Nothing}` in the future.
1 parent efe1d97 commit 07b15e8

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ context-aware single variable of the IR. Its fields are described as follows:
182182
### Operations
183183

184184
Operations are the basic composition of variables and puts together the pieces
185-
with a function. The `~` function denotes equality
186-
between the arguments.
185+
with a function. The `~` function denotes equality between the arguments.
187186

188187
### Differentials
189188

src/differentials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
struct Differential
2-
x::Union{Variable,Operation}
1+
struct Differential <: Expression
2+
x::Expression
33
order::Int
44
end
55
Differential(x) = Differential(x,1)

src/variables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mutable struct Variable <: Expression
33
value
44
value_type::DataType
55
subtype::Symbol
6-
diff::Union{Differential,Nothing}
6+
diff::Union{Expression,Nothing} # FIXME
77
dependents::Vector{Variable}
88
description::String
99
flow::Bool

0 commit comments

Comments
 (0)