groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Afanasiev (JIRA)" <>
Subject [jira] [Created] (GROOVY-8293) Instanceof inference does work on fields
Date Mon, 21 Aug 2017 15:53:00 GMT
Alexey Afanasiev created GROOVY-8293:

             Summary: Instanceof inference does work on fields
                 Key: GROOVY-8293
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation, Static Type Checker
    Affects Versions: 2.4.12
            Reporter: Alexey Afanasiev

This code should not compile:

import groovy.transform.CompileStatic

class Foo {
    Object str = "str"
    def bar() {
        if (str instanceof String) {
            str.toUpperCase() // here should be compile error

_it does not perform any kind of type inference on fields, always falling back to the declared
type of a field_

This message was sent by Atlassian JIRA

View raw message