Files
swift-mirror/test/expr/print/literals.swift
Louis D'hauwe a89ea380a9 [ASTPrinter] Print expressions
Add new `-print-ast-decl` frontend option for only printing declarations,
to match existing behavior.
Some tests want to print the AST, but don't care about expressions.

The existing `-print-ast` option now prints function bodies and expressions.
Not all expressions are printed yet, but most common ones are.
2022-01-11 14:24:16 -08:00

19 lines
329 B
Swift

// RUN: %target-swift-frontend -print-ast %s 2>&1 | %FileCheck %s
// CHECK-LABEL: func test() {
func test() {
log(1)
log(1.0)
log(true)
log([1, 2, 3])
log([1: true, 2: false])
}
// CHECK: log(1)
// CHECK: log(1.0)
// CHECK: log(true)
// CHECK: log([1, 2, 3])
// CHECK: log([1: true, 2: false])
func log(_ a: Any) {
}