blob: cdc386eecf8fbbe2150c50aeefb6b575e617a1a8 [file] [log] [blame]
/*
* Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @assertion It is possible to embed expressions within non-raw string literals, such that these
* expressions are evaluated, and the resulting values are converted into strings and concatenated
* with the enclosing string. This process is known as string interpolation.
* STRING_INTERPOLATION:
* '$' IDENTIFIER_NO_DOLLAR
* | '$' '{' Expression '}'
* ;
* @description Checks that it is a runtime error if the identifier used in a string
* interpolation construct is not declared in the current scope.
* @static-warning
* @author msyabro
* @reviewer rodionov
*/
import "../../../Utils/expect.dart";
main() {
try {
"${nonExistingVariable}"; /// static type warning - see "Identifier reference"
Expect.fail("NoSuchMethodError expected when calling undefined getter.");
} on NoSuchMethodError catch (ex) {}
}