# Generated functions and world age

**URL:** https://discourse.julialang.org/t/generated-functions-and-world-age/1867
**Category:** General Usage
**Created:** [February 3, 2017, 2:30pm UTC](https://discourse.julialang.org/t/generated-functions-and-world-age/1867 "2017-02-03T14:30:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)
#### Post date: [February 3, 2017, 2:30pm UTC](https://discourse.julialang.org/t/generated-functions-and-world-age/1867/1 "2017-02-03T14:30:47Z")

</div>

The following used to work, but doesn’t anymore:

```julia
julia> @generated f()=g()
f (generic function with 1 method)

julia> g() = 2
g (generic function with 1 method)

julia> f()
ERROR: MethodError: no method matching g()
The applicable method may be too new: running in world age 21269, while current world is 21270.
Closest candidates are:
  g() at REPL[2]:1 (method too new to be called from this world context.)
Stacktrace:
 [1] f(...) at ./REPL[1]:1

```

Is this a bug or a known limitation?  
The above happens a lot in the [Interpolations](https://github.com/tlycken/Interpolations.jl) package, which relies on generated functions in many places.

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [February 3, 2017, 2:44pm UTC](https://discourse.julialang.org/t/generated-functions-and-world-age/1867/2 "2017-02-03T14:44:20Z")

</div>

This is a known feature. [https://github.com/JuliaLang/julia/issues/19942](https://github.com/JuliaLang/julia/issues/19942)
