Created
November 24, 2015 21:18
-
-
Save RomanSaveljev/71ed29b0df3eb306485c to your computer and use it in GitHub Desktop.
Groovy bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
A() { | |
func() | |
} | |
void func() { | |
} | |
} | |
void func() { | |
def t = false | |
def a = new A() { | |
@Override | |
void func() { | |
assert t != null | |
println "t is ${t}" | |
} | |
} | |
//t = true | |
a.func() | |
} | |
func() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.RomanSaveljev.modemchat; | |
/* Name of the class has to be "Main" only if the class is public. */ | |
class Ideone | |
{ | |
private static class A { | |
A() { | |
func(); | |
} | |
void func() { | |
} | |
} | |
static void func() { | |
Boolean t = false; | |
A a = new A() { | |
@Override | |
void func() { | |
assert t != null; | |
System.out.println(t.toString()); | |
//println "t is ${t}" | |
} | |
}; | |
//t = true | |
a.func(); | |
} | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
System.out.println("MOOO"); | |
func(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment