From 229a4e2195e7cdb3d5a66368bfe10948cfa8ae07 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 7 Jan 2024 18:26:15 -0600 Subject: [PATCH] Allow `using Mod as NewName` in v1.11+ --- src/parser.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.jl b/src/parser.jl index 34666b59..601ae758 100644 --- a/src/parser.jl +++ b/src/parser.jl @@ -2483,10 +2483,10 @@ function parse_import(ps::ParseState, word, has_import_prefix) parse_atsym(ps) emit(ps, mark, K"as") if word == K"using" && !has_import_prefix + # v1.10: # using A as B ==> (using (error (as (importpath A) B))) # using A, B as C ==> (using (importpath A) (error (as (importpath B) C))) - emit(ps, mark, K"error", - error="`using` with `as` renaming requires a `:` and context module") + min_supported_version(v"1.11", ps, mark, "`using Mod as NewName`") end #v1.5: import A as B ==> (import (error (as (importpath A) B))) min_supported_version(v"1.6", ps, mark, "`import ... as`")