Skip to content

Commit e939e99

Browse files
committed
fix imports from Core/Base
1 parent abce6d0 commit e939e99

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/frompackage/imports_helpers.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ function process_modpath!(mwn::ModuleWithNames, p::FromPackageController{name};
145145
elseif root_name === :>
146146
# Deps import
147147
@assert !is_catchall(mwn) "You can't use the catch-all expression when importing from dependencies"
148-
m = get_dep_from_loaded_modules(p, first(path); allow_manifest=true)
148+
modname = first(path)
149+
m = if modname in (:Base, :Core)
150+
modname == :Base ? Base : Core
151+
else
152+
get_dep_from_loaded_modules(p, first(path); allow_manifest=true)
153+
end
149154
# Replace the deps name with the uuid_name symbol from loaded modules
150155
path[1] = unique_module_name(m)
151156
# Add the loaded module path

test/TestPackage/src/TestPackage.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module TestPackage
33
import PlutoDevMacros
44
export toplevel_variable
55

6+
using Base.Threads: Threads, Event
7+
using Core: MethodTable
8+
69
const TEST_INIT = Ref{Int}(0)
710

811
toplevel_variable = 15

test/TestPackage/src/notebook1.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### A Pluto.jl notebook ###
2-
# v0.20.13
2+
# v0.20.18
33

44
using Markdown
55
using InteractiveUtils
@@ -32,9 +32,17 @@ toplevel_variable + hidden_toplevel_variable
3232
# # We define a method
3333
testmethod(x) = "ANY"
3434

35+
# ╔═╡ cd0230d0-2a08-4839-a788-630fbce8faf1
36+
Event == Base.Threads.Event || error("There was a problem loading from Base")
37+
38+
# ╔═╡ 6338e7c7-8218-4e65-beca-94e43ece936e
39+
MethodTable == Core.MethodTable || error("There was a problem loading from Core")
40+
3541
# ╔═╡ Cell order:
3642
# ╠═8de53a58-e6ab-11ed-1db7-ef087d78eaef
3743
# ╠═22f0a6a4-907b-4389-b6b7-1f175289c69b
3844
# ╠═cf9f785b-f8f5-4d1b-9a48-ca5983843ba4
3945
# ╠═9a8ae7e2-d3c4-4cf2-876e-bcde84741540
4046
# ╠═c9997396-bd93-41f1-8c3c-d13c7c6c5c3e
47+
# ╠═cd0230d0-2a08-4839-a788-630fbce8faf1
48+
# ╠═6338e7c7-8218-4e65-beca-94e43ece936e

0 commit comments

Comments
 (0)