Skip to content

Commit 0f13cd6

Browse files
authored
changes to fsmi_generator to support julia 1.12 (#124)
1 parent bbbe537 commit 0f13cd6

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# News
22

3+
## v1.0.3 - 2025-03-24
4+
5+
- Internal changes to `fsmi_generator` to support julia 1.12
6+
37
## v1.0.2 - 2025-02-07
48

59
- Support shadowing of globals, e.g. `@resumable function f(); a=a+1; end;` where `a` is already an existing global.
610

711
## v1.0.1 - 2024-11-23
812

9-
- Better macro hygiene (e.g. for better support in Pluto.jl)
13+
- Better macro hygiene (e.g. for better support in Pluto.jl)
1014

1115
## v1.0.0 - 2024-11-22
1216

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = "MIT"
55
desc = "C# sharp style generators a.k.a. semi-coroutines for Julia."
66
authors = ["Ben Lauwens and volunteer maintainers"]
77
repo = "https://github.com/JuliaDynamics/ResumableFunctions.jl.git"
8-
version = "1.0.2"
8+
version = "1.0.3"
99

1010
[deps]
1111
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"

src/utils.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function code_typed_by_type(@nospecialize(tt::Type);
148148
return frame.linfo, frame.src, valid_worlds
149149
end
150150

151-
function fsmi_generator(world::UInt, source::LineNumberNode, passtype, fsmitype::Type{Type{T}}, fargtypes) where T
151+
function fsmi_generator(world::UInt, source, passtype, fsmitype::Type{Type{T}}, fargtypes) where T
152152
@nospecialize
153153
# get typed code of the inference function evaluated in get_slots
154154
# but this time with concrete argument types
@@ -179,20 +179,10 @@ function fsmi_generator(world::UInt, source::LineNumberNode, passtype, fsmitype:
179179
# generate code to instantiate the concrete type
180180
stub = Core.GeneratedFunctionStub(identity, Core.svec(:pass, :fsmi, :fargs), Core.svec())
181181
if isempty(slots)
182-
exprs = stub(world, source, :(return $T()))
182+
return stub(world, source, :(return $T()))
183183
else
184-
exprs = stub(world, source, :(return $T{$(slots...)}()))
184+
return stub(world, source, :(return $T{$(slots...)}()))
185185
end
186-
# lower codeinfo to pass world age and invalidation edges
187-
ci = ccall(:jl_expand_and_resolve, Any, (Any, Any, Any), exprs, passtype.name.module, Core.svec())
188-
ci.min_world = min_world
189-
ci.max_world = max_world
190-
ci.edges = Core.MethodInstance[mi]
191-
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs) # due to julia#54341
192-
ci.nargs = 3
193-
ci.isva = true
194-
end
195-
return ci
196186
end
197187

198188
# JuliaLang/julia#48611: world age is exposed to generated functions, and should be used

0 commit comments

Comments
 (0)