We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachment: Download
Xcode 12.4 Swift 5.3
md5: 178cc12bc0a78e3983601e39200f1d01
Issue Description:
Given a swift file with the following code
public extension Int { var i: Int { 0 } func times2() -> Int { self * self } static func afunction() {} static func afunction1() {} } extension Int { public func times3() -> Int { self * self } static public func afunction2() {} }
When trying to dump the pre-typechecked AST with `swiftc -dump-parse syntax.swift` , I'm seeing a diagnostics that to me it shouldn't be there.
syntax.swift:11:11: error: cannot find type 'Int' in scope extension Int { ^~~ <<error type>>
Here is the full dump
In text
(source_file "syntax.swift" (extension_decl range=[syntax.swift:1:8 - line:9:1] syntax.swift:1:18: error: cannot find type 'Int' in scope public extension Int { ^~~ <<error type>> (pattern_binding_decl range=[syntax.swift:2:5 - line:2:20] (pattern_typed (pattern_named 'i') (type_ident (component id='Int' bind=none)))) (var_decl range=[syntax.swift:2:9 - line:2:9] "i" type='<null type>' readImpl=getter immutable (accessor_decl range=[syntax.swift:2:16 - line:2:20] 'anonname=0x7ff004841ad0' get_for=i (parameter "self") (parameter_list) (integer_literal_expr type='<null>' value=0 builtin_initializer=**NULL** initializer=**NULL**))) (func_decl range=[syntax.swift:4:5 - line:4:40] "times2()" (parameter "self") (parameter_list range=[syntax.swift:4:16 - line:4:17]) (result (type_ident (component id='Int' bind=none))) (sequence_expr type='<null>' (declref_expr type='<null>' decl=syntax.(file). extension.times2().self@syntax.swift:4:10 function_ref=unapplied) (unresolved_decl_ref_expr type='<null>' name=* function_ref=unapplied) (declref_expr type='<null>' decl=syntax.(file). extension.times2().self@syntax.swift:4:10 function_ref=unapplied))) (func_decl range=[syntax.swift:6:5 - line:6:30] "afunction()" type (parameter "self") (parameter_list range=[syntax.swift:6:26 - line:6:27]) (brace_stmt range=[syntax.swift:6:29 - line:6:30])) (func_decl range=[syntax.swift:8:5 - line:8:31] "afunction1()" type (parameter "self") (parameter_list range=[syntax.swift:8:27 - line:8:28]) (brace_stmt range=[syntax.swift:8:30 - line:8:31]))) (extension_decl range=[syntax.swift:11:1 - line:15:1] syntax.swift:11:11: error: cannot find type 'Int' in scope extension Int { ^~~ <<error type>> (func_decl range=[syntax.swift:12:12 - line:12:47] "times3()" (parameter "self") (parameter_list range=[syntax.swift:12:23 - line:12:24]) (result (type_ident (component id='Int' bind=none))) (sequence_expr type='<null>' (declref_expr type='<null>' decl=syntax.(file). extension.times3().self@syntax.swift:12:17 function_ref=unapplied) (unresolved_decl_ref_expr type='<null>' name=* function_ref=unapplied) (declref_expr type='<null>' decl=syntax.(file). extension.times3().self@syntax.swift:12:17 function_ref=unapplied))) (func_decl range=[syntax.swift:14:5 - line:14:38] "afunction2()" type (parameter "self") (parameter_list range=[syntax.swift:14:34 - line:14:35]) (brace_stmt range=[syntax.swift:14:37 - line:14:38]))))
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
I can reproduce in 12.4 but not on main. @LucianoPAlmeida would you be able to verify it's fixed in the latest toolchain?
Sure, I'll try on main. Thanks for looking
On compiler explorer main is still reproducible
But I have a near main branch built, will check there to make sure
Just verified on a near main branch using lit, seems fixed! Thanks for taking a look @bnbarham =]
No problem, thanks for verifying so quickly!
No branches or pull requests
Attachment: Download
Environment
Xcode 12.4 Swift 5.3
Additional Detail from JIRA
md5: 178cc12bc0a78e3983601e39200f1d01
Issue Description:
Given a swift file with the following code
When trying to dump the pre-typechecked AST with `swiftc -dump-parse syntax.swift` , I'm seeing a diagnostics that to me it shouldn't be there.
Here is the full dump
In text
The text was updated successfully, but these errors were encountered: