Files
swift-mirror/test/attr/ApplicationMain/attr_main_throws.swift
Rintaro Ishizaki 71b24665fa [ASTDumper] Dump DeclContext
* Include `DeclContext` of the node where possible
* Add 'default-with-decl-contexts' dump style that dumps the dect context
  hierarchy in addition to the AST
* Support `-dump-parse` with `-dump-ast-format json`
2025-02-12 10:53:33 -08:00

17 lines
625 B
Swift

// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
// RUN: %target-swift-frontend -dump-ast -parse-as-library %s | %FileCheck %s --check-prefix=CHECK-AST
@main
struct MyBase {
static func main() throws {
}
}
// CHECK-AST: (func_decl {{.*}} implicit "$main()" interface_type="(MyBase.Type) -> () throws -> ()" access=internal static
// CHECK-AST-NEXT: (parameter "self" {{.*}})
// CHECK-AST-NEXT: (parameter_list)
// CHECK-AST-NEXT: (brace_stmt implicit
// CHECK-AST-NEXT: (return_stmt implicit
// CHECK-AST-NEXT: (try_expr implicit
// CHECK-AST-NEXT: (call_expr implicit type="()"